World Data League 2022

🎯 Challenge

Air Quality Prediction in Busy Streets by UNStudio

👥 Authors

  • Akshay Punjabi
  • Pablo Izquierdo Ayala
  • Enrico Coluccia
  • Chiara Rucco

💻 Development

Data Loading

Getting the data

In [1]:
!wget https://wdl-data.fra1.digitaloceanspaces.com/unstudio/stadhouderskade_air_quality_2014_to_2022.csv
--2022-03-24 12:32:33--  https://wdl-data.fra1.digitaloceanspaces.com/unstudio/stadhouderskade_air_quality_2014_to_2022.csv
Resolving wdl-data.fra1.digitaloceanspaces.com (wdl-data.fra1.digitaloceanspaces.com)... 5.101.109.44
Connecting to wdl-data.fra1.digitaloceanspaces.com (wdl-data.fra1.digitaloceanspaces.com)|5.101.109.44|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 42781992 (41M) []
Saving to: ‘stadhouderskade_air_quality_2014_to_2022.csv.5’

stadhouderskade_air 100%[===================>]  40.80M  18.5MB/s    in 2.2s    

2022-03-24 12:32:35 (18.5 MB/s) - ‘stadhouderskade_air_quality_2014_to_2022.csv.5’ saved [42781992/42781992]

Imports

In [2]:
!pip install catboost shap kaleido
Requirement already satisfied: catboost in /usr/local/lib/python3.7/dist-packages (1.0.4)
Requirement already satisfied: shap in /usr/local/lib/python3.7/dist-packages (0.40.0)
Requirement already satisfied: kaleido in /usr/local/lib/python3.7/dist-packages (0.2.1)
Requirement already satisfied: six in /usr/local/lib/python3.7/dist-packages (from catboost) (1.15.0)
Requirement already satisfied: matplotlib in /usr/local/lib/python3.7/dist-packages (from catboost) (3.2.2)
Requirement already satisfied: plotly in /usr/local/lib/python3.7/dist-packages (from catboost) (5.5.0)
Requirement already satisfied: graphviz in /usr/local/lib/python3.7/dist-packages (from catboost) (0.10.1)
Requirement already satisfied: numpy>=1.16.0 in /usr/local/lib/python3.7/dist-packages (from catboost) (1.21.5)
Requirement already satisfied: scipy in /usr/local/lib/python3.7/dist-packages (from catboost) (1.4.1)
Requirement already satisfied: pandas>=0.24.0 in /usr/local/lib/python3.7/dist-packages (from catboost) (1.3.5)
Requirement already satisfied: python-dateutil>=2.7.3 in /usr/local/lib/python3.7/dist-packages (from pandas>=0.24.0->catboost) (2.8.2)
Requirement already satisfied: pytz>=2017.3 in /usr/local/lib/python3.7/dist-packages (from pandas>=0.24.0->catboost) (2018.9)
Requirement already satisfied: tqdm>4.25.0 in /usr/local/lib/python3.7/dist-packages (from shap) (4.63.0)
Requirement already satisfied: numba in /usr/local/lib/python3.7/dist-packages (from shap) (0.51.2)
Requirement already satisfied: slicer==0.0.7 in /usr/local/lib/python3.7/dist-packages (from shap) (0.0.7)
Requirement already satisfied: cloudpickle in /usr/local/lib/python3.7/dist-packages (from shap) (1.3.0)
Requirement already satisfied: scikit-learn in /usr/local/lib/python3.7/dist-packages (from shap) (1.0.2)
Requirement already satisfied: packaging>20.9 in /usr/local/lib/python3.7/dist-packages (from shap) (21.3)
Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in /usr/local/lib/python3.7/dist-packages (from packaging>20.9->shap) (3.0.7)
Requirement already satisfied: kiwisolver>=1.0.1 in /usr/local/lib/python3.7/dist-packages (from matplotlib->catboost) (1.4.0)
Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python3.7/dist-packages (from matplotlib->catboost) (0.11.0)
Requirement already satisfied: typing-extensions in /usr/local/lib/python3.7/dist-packages (from kiwisolver>=1.0.1->matplotlib->catboost) (3.10.0.2)
Requirement already satisfied: llvmlite<0.35,>=0.34.0.dev0 in /usr/local/lib/python3.7/dist-packages (from numba->shap) (0.34.0)
Requirement already satisfied: setuptools in /usr/local/lib/python3.7/dist-packages (from numba->shap) (57.4.0)
Requirement already satisfied: tenacity>=6.2.0 in /usr/local/lib/python3.7/dist-packages (from plotly->catboost) (8.0.1)
Requirement already satisfied: joblib>=0.11 in /usr/local/lib/python3.7/dist-packages (from scikit-learn->shap) (1.1.0)
Requirement already satisfied: threadpoolctl>=2.0.0 in /usr/local/lib/python3.7/dist-packages (from scikit-learn->shap) (3.1.0)
In [3]:
import warnings
import matplotlib as mpl
import numpy as np
import pandas as pd 
import statsmodels as sm
import tensorflow as tf
from matplotlib import pyplot as plt
from pylab import rcParams
import datetime

from statsmodels.graphics.tsaplots import plot_acf, plot_pacf
from statsmodels.tsa import api as smt
from statsmodels.tsa.seasonal import seasonal_decompose
from statsmodels.tsa.stattools import adfuller

import plotly.express as px
from plotly.subplots import make_subplots
import plotly.figure_factory as ff
import plotly.offline as offline
import plotly.graph_objs as go

import xgboost as xgb
from catboost import CatBoostClassifier
from catboost import CatBoost, Pool
from sklearn.linear_model import LinearRegression
from sklearn.model_selection import train_test_split, cross_val_predict
from sklearn.metrics import accuracy_score
import shap

from itertools import cycle

warnings.filterwarnings("ignore")

seed = 42
tf.random.set_seed(seed)
np.random.seed(seed)
plt.style.use('bmh')
mpl.rcParams['axes.labelsize'] = 14
mpl.rcParams['xtick.labelsize'] = 12
mpl.rcParams['ytick.labelsize'] = 12
mpl.rcParams['text.color'] = 'k'
print(tf.__version__)
/usr/local/lib/python3.7/dist-packages/statsmodels/tools/_testing.py:19: FutureWarning: pandas.util.testing is deprecated. Use the functions in the public API at pandas.testing instead.
  import pandas.util.testing as tm
2.8.0
In [4]:
import plotly.io as pio

pio.renderers.default = "svg"

Loading DataFrame

In [5]:
df = pd.read_csv("/content/stadhouderskade_air_quality_2014_to_2022.csv", parse_dates=['timestamp_measured'], usecols=['component_id', 'value', 'timestamp_measured'])

Exploratory Data Analysis (EDA)

First steps

Overview

In [6]:
df.head()
Out[6]:
component_id value timestamp_measured
0 PM25 7.40 2022-02-15 23:00:00+00:00
1 PM10 12.30 2022-02-15 23:00:00+00:00
2 FN 0.29 2022-02-15 23:00:00+00:00
3 C8H10 0.32 2022-02-15 23:00:00+00:00
4 C7H8 0.55 2022-02-15 23:00:00+00:00
In [7]:
df.groupby("component_id").describe()
Out[7]:
value
count mean std min 25% 50% 75% max
component_id
C6H6 66350.0 0.606324 5.012635 -99.0 0.42 0.71 1.12 55.12
C7H8 66456.0 2.674955 5.729336 -99.0 1.07 2.19 3.95 62.43
C8H10 57135.0 0.849715 5.629685 -99.0 0.30 0.66 1.43 160.47
FN 69955.0 1.295385 1.480673 -99.0 0.69 1.08 1.65 14.28
NO 69229.0 16.791309 21.259234 -99.0 5.20 11.10 20.80 489.50
NO2 69221.0 32.280101 17.730666 -99.0 19.30 29.40 42.30 154.80
PM10 69412.0 20.021171 12.757697 -99.0 12.10 17.80 24.90 536.90
PM25 69419.0 12.622641 11.175225 -99.0 6.10 9.60 16.10 508.80

As we can see, different pollutants have different ranges and values. This will be important later on when computing the Air Quality Index. There are also some missing values (-99) which are negative, so we will also remove all negative values

Missing Values

In [8]:
print(f'Number of rows: {df.shape[0]};  Number of columns: {df.shape[1]}; Number of missing values: {sum(df.isna().sum())}')
Number of rows: 548357;  Number of columns: 3; Number of missing values: 11180
In [9]:
print(df.isna().sum())
component_id          11180
value                     0
timestamp_measured        0
dtype: int64

We observe some missing rows, but they do not contain information, so we will just remove them.

In [10]:
df = df.dropna()
df = df[df.value > 0]
print(f'Number of rows: {df.shape[0]}; No of missing values: {sum(df.isna().sum())}')
Number of rows: 533851; No of missing values: 0

General information

In [11]:
unique_times = df['timestamp_measured'].unique()
print(f'Number of unique times: {unique_times.shape[0]}')
print(f'Earliest date: {unique_times.min()}')
print(f'Latest date: {unique_times.max()}')
Number of unique times: 70843
Earliest date: 2014-01-01 00:00:00+00:00
Latest date: 2022-02-16 22:00:00+00:00

Pivoting Table

Instead of having one row per pollutant and timestamp, we pivot the table and convert each pollutant into a column so we have a more comprehensive way of addressing the data

In [12]:
df = df.set_index('timestamp_measured')
df = df.pivot_table('value', 'timestamp_measured', 'component_id').reset_index()
df.head()
Out[12]:
component_id timestamp_measured C6H6 C7H8 C8H10 FN NO NO2 PM10 PM25
0 2014-01-01 00:00:00+00:00 NaN NaN NaN NaN 27.0 43.0 NaN NaN
1 2014-01-01 01:00:00+00:00 1.21 1.41 NaN 2.38 30.0 42.0 90.3 74.7
2 2014-01-01 02:00:00+00:00 0.97 1.65 NaN 2.55 28.0 50.0 97.3 84.0
3 2014-01-01 03:00:00+00:00 1.11 1.98 NaN 2.50 24.0 48.0 41.6 34.7
4 2014-01-01 04:00:00+00:00 1.04 2.31 NaN 2.18 19.0 45.0 28.1 20.6

Missing Values

In [13]:
print(df.isna().sum())
component_id
timestamp_measured        0
C6H6                   5038
C7H8                   5001
C8H10                 14294
FN                      921
NO                     2154
NO2                    1752
PM10                   1606
PM25                   2319
dtype: int64

After pivoting the table, we observe a considerable amount of NaN values. The C8H10 contains a huge percentage of NaNs.

Overview plots

In [14]:
rcParams['figure.figsize'] = 18, 15
values = df.values
groups = [1, 2, 3, 4, 5, 6, 7, 8]
i = 1
# plot each column
for group in groups:
    plt.subplot(len(groups), 1, i)
    plt.plot(values[:, group])
    plt.title(df.columns[group], y=0.5, loc='right')
    i += 1


plt.show()

We decide to drop the C8H10 column. We also decide to fill the remaining empty values. Given the nature of the data (timeseries), we decide to use a ffill and we carry forward the last occurrence of the dataset for any NaN value.

In [15]:
df = df.fillna(method='ffill')
df = df.drop(columns='C8H10')
df.sort_index(inplace = True)
df = df.dropna()

Looking at seasonal components

In order to understand the data a bit more and following the zoom WDL presentation, we decide to look into the seasonal components of the data.

NO2

In [16]:
rcParams['figure.figsize'] = 18, 8
plt.figure(num=None, figsize=(50, 20), dpi=80, facecolor='w', edgecolor='k')
series = df.NO2
result = seasonal_decompose(series, model='multiplicative', freq = 8760)
res = result.plot()
<Figure size 4000x1600 with 0 Axes>

PM2.5

In [17]:
rcParams['figure.figsize'] = 18, 8
plt.figure(num=None, figsize=(50, 20), dpi=80, facecolor='w', edgecolor='k')
series = df.PM25
result = seasonal_decompose(series, model='multiplicative', freq = 8760)
res = result.plot()
<Figure size 4000x1600 with 0 Axes>

We extract two important insights from these plots that can be applied to all of the pollutants.

First, the overall trend seems to be decreasing,the amount of pollutant seems to have decreased from 2015 up to today. Second, there seems to be some sort of seasonality in the data, with important peaks at the beginning of each year.

(Please see the Appendix with the remaining plots and further tests)


Air Quality Index

We noticed some seasonality in the previous stage, as well as a clear downwards trend. With this in mind, we decided to compute the Common Air Quality Index.

The CAQI is a metric used by the governments to communicate to the population how polluted the air is.

caqi.PNG

As shown in the table above, this metric is obtained by means of thresholding the values of some of the pollutants that are available in our dataset. By doing so, we obtain a value that then corresponds to one of 5 categories, ranging from 1 - Very low risk to 5 - Very High.

We will use this value to the estimate the levels of pollution present in Stadhouderskade.

(Note that each country has their own Air Quality Index. We decided to use the Common Air Quality Index as this is the European standard.)

CAQI Formulas

In [18]:
## PM25 CAQI calculation
def get_PM25_subindex(x):
    if x <= 15:
        return 1
    elif x <= 30:
        return 2
    elif x <= 55:
        return 3
    elif x <= 110:
        return 4
    elif x > 110:
        return 5
    else:
        return 0

def get_PM10_subindex(x):
    if x <= 25:
        return 1
    elif x <= 50:
        return 2
    elif x <= 90:
        return 3
    elif x <= 180:
        return 4
    elif x > 180:
        return 5
    else:
        return 0

def get_NOx_subindex(x):
    if x <= 50:
        return 1
    elif x <= 100:
        return 2
    elif x <= 200:
        return 3
    elif x <= 400:
        return 4
    elif x > 400:
        return 5
    else:
        return 0

def get_AQI(x):
    if x == 1:
        return 1 # 'Very Low'
    elif x == 2:
        return 2 # 'Low'
    elif x == 3:
        return 3 # 'Medium'
    elif x == 4:
        return 4 # 'High'
    elif x == 5:
        return 5 # 'Very High'
    else:
        return 0

Obtaining CAQI

Here we apply the formula to each of the 3 pollutants. We also extract the overall CAQI by selecting the maximum CAQI value from the 3 pollutants.

In [19]:
df["PM25_CAQI"] = df["PM25"].apply(lambda x: get_PM25_subindex(x))
df["PM10_CAQI"] = df["PM10"].apply(lambda x: get_PM10_subindex(x))
df["NO2_CAQI"] = df["NO2"].apply(lambda x: get_NOx_subindex(x))
df['CAQI'] = df[['PM25_CAQI', 'PM10_CAQI', 'NO2_CAQI']].max(axis=1).apply(lambda x: get_AQI(x))

Analysing CAQI

Extract of days with the worse CAQI values

In [20]:
df.loc[(df['CAQI'] == 5)]
Out[20]:
component_id timestamp_measured C6H6 C7H8 FN NO NO2 PM10 PM25 PM25_CAQI PM10_CAQI NO2_CAQI CAQI
8735 2015-01-01 01:00:00+00:00 1.56 4.52 7.03 35.6 56.1 222.1 190.6 5 5 2 5
8736 2015-01-01 02:00:00+00:00 2.08 5.31 8.60 42.7 59.2 238.9 203.9 5 5 2 5
8737 2015-01-01 03:00:00+00:00 1.79 4.67 7.88 30.7 54.2 171.0 148.5 5 4 2 5
17241 2016-01-01 01:00:00+00:00 0.13 0.24 6.21 41.0 54.9 207.7 173.3 5 5 2 5
17242 2016-01-01 02:00:00+00:00 0.13 0.24 8.34 34.4 52.2 151.4 130.3 5 4 2 5
18402 2016-02-18 11:00:00+00:00 1.18 5.32 2.42 48.3 48.7 33.8 192.7 5 2 1 5
25432 2016-12-09 10:00:00+00:00 1.90 5.00 3.44 74.7 48.5 311.1 49.6 3 5 1 5
25968 2016-12-31 18:00:00+00:00 2.38 5.61 4.32 47.9 55.6 144.1 131.9 5 4 2 5
25974 2017-01-01 00:00:00+00:00 2.43 3.43 7.12 68.4 51.9 513.9 499.0 5 5 2 5
25975 2017-01-01 01:00:00+00:00 2.74 3.67 7.34 60.2 53.0 230.0 194.6 5 5 2 5
25976 2017-01-01 02:00:00+00:00 2.87 3.74 8.89 58.0 51.2 257.5 225.5 5 5 2 5
25977 2017-01-01 03:00:00+00:00 2.88 3.67 7.59 54.9 54.0 162.0 142.9 5 4 2 5
34677 2018-01-01 00:00:00+00:00 1.08 1.57 2.41 16.2 32.6 246.2 218.9 5 5 1 5
41329 2018-10-05 20:00:00+00:00 4.16 22.80 10.05 179.0 88.5 299.0 69.6 4 5 2 5
43421 2019-01-01 00:00:00+00:00 0.99 0.62 3.94 32.4 37.7 536.9 508.8 5 5 1 5
46062 2019-04-21 06:00:00+00:00 2.70 2.10 7.99 3.5 21.2 130.8 120.4 5 4 1 5
46063 2019-04-21 07:00:00+00:00 2.99 1.73 8.96 5.9 22.8 135.5 133.5 5 4 1 5
46064 2019-04-21 08:00:00+00:00 2.96 2.03 7.76 8.3 30.0 126.4 113.8 5 4 1 5
47578 2019-06-23 12:00:00+00:00 0.52 1.74 1.62 20.7 35.7 30.8 120.6 5 2 1 5
48018 2019-07-11 20:00:00+00:00 0.06 0.23 0.99 11.4 27.6 15.7 313.7 5 1 1 5
50352 2019-10-17 02:00:00+00:00 0.25 1.34 0.59 0.7 17.7 283.3 1.1 1 5 1 5
52174 2020-01-01 00:00:00+00:00 1.08 1.16 6.03 33.3 45.4 451.1 438.8 5 5 1 5
52175 2020-01-01 01:00:00+00:00 1.29 1.70 4.35 14.3 41.9 252.3 208.1 5 5 1 5
52176 2020-01-01 02:00:00+00:00 1.29 1.70 4.51 18.2 32.2 137.2 121.3 5 4 1 5
60957 2021-01-01 00:00:00+00:00 3.12 2.80 8.14 53.9 56.2 317.3 319.9 5 5 2 5
60958 2021-01-01 01:00:00+00:00 3.82 3.31 8.85 42.1 59.9 130.6 121.3 5 4 2 5
60959 2021-01-01 02:00:00+00:00 3.42 3.28 9.08 42.7 60.1 124.8 119.0 5 4 2 5
60960 2021-01-01 03:00:00+00:00 3.81 3.77 10.75 53.8 65.2 145.9 139.1 5 4 2 5
60961 2021-01-01 04:00:00+00:00 4.51 3.82 12.88 53.2 64.6 183.9 172.2 5 5 2 5
60962 2021-01-01 05:00:00+00:00 5.00 2.95 12.88 53.8 63.8 225.6 206.5 5 5 2 5
60963 2021-01-01 06:00:00+00:00 5.81 3.58 14.28 39.7 61.3 187.8 186.1 5 5 2 5
60964 2021-01-01 07:00:00+00:00 5.92 3.85 12.68 35.1 61.0 146.2 133.8 5 4 2 5
69717 2022-01-01 00:00:00+00:00 0.48 0.54 2.09 9.7 26.9 157.6 116.0 5 4 1 5

We noticed that the worse CAQI values can be obtained in New Years Eve. This can be explained due to this street being in the middle of Amsterdam, where most of the celebrations take place. These celebrations presumably include fireworks that highly pollute the air.

It is also interesting to see that there are some individual dates that had a high pollution value. We did some research and some of this dates some of these dates correspond to massive events, i.e a dance event on the week of the 17 of October 2019, where the venue was located just at the end of this street and probably leading to a lot of traffic.

With all of this in mind, we decided to make a more comprehensive plot that gives an accurate of the CAQI measurement throughout the year

In [21]:
very_low = "#79bc6a"
low = "#bbcf4c"
medium = "#eec20b"
high = "#f29305"
very_high = "#e8416f"
colors = [very_low, low, medium, high, very_high]


def discrete_colorscale(bvals, colors):
    """
    bvals - list of values bounding intervals/ranges of interest
    colors - list of rgb or hex colorcodes for values in [bvals[k], bvals[k+1]],0<=k < len(bvals)-1
    returns the plotly  discrete colorscale
    """
    if len(bvals) != len(colors)+1:
        raise ValueError('len(boundary values) should be equal to  len(colors)+1')
    bvals = sorted(bvals)     
    nvals = [(v-bvals[0])/(bvals[-1]-bvals[0]) for v in bvals]  #normalized values
    
    dcolorscale = [] #discrete colorscale
    for k in range(len(colors)):
        dcolorscale.extend([[nvals[k], colors[k]], [nvals[k+1], colors[k]]])
    return dcolorscale    

def display_year(z,
                 year: int = None,
                 month_lines: bool = True,
                 fig=None,
                 row: int = None):
    
    if year is None:
        year = datetime.datetime.now().year
    
    data = np.ones(365) * np.nan
    data[:len(z)] = z
    

    d1 = datetime.date(year, 1, 1)
    d2 = datetime.date(year, 12, 31)

    delta = d2 - d1
    
    month_names = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
    month_days =   [31,    28,    31,     30,    31,     30,    31,    31,    30,    31,    30,    31]
    month_positions = (np.cumsum(month_days) - 15)/7

    dates_in_year = [d1 + datetime.timedelta(i) for i in range(delta.days+1)] #gives me a list with datetimes for each day a year
    weekdays_in_year = [i.weekday() for i in dates_in_year] #gives [0,1,2,3,4,5,6,0,1,2,3,4,5,6,…] (ticktext in xaxis dict translates this to weekdays
    
    weeknumber_of_dates = [int(i.strftime("%V")) if not (int(i.strftime("%V")) == 1 and i.month == 12) else 53
                           for i in dates_in_year] #gives [1,1,1,1,1,1,1,2,2,2,2,2,2,2,…] name is self-explanatory
    text = [str(i) for i in dates_in_year] #gives something like list of strings like ‘2018-01-25’ for each date. Used in data trace to make good hovertext.
    #4cc417 green #347c17 dark green
    colorscale=discrete_colorscale([0, 1, 2, 3, 4, 5], colors)
    
    # handle end of year
    

    data = [
        go.Heatmap(
            x=weeknumber_of_dates,
            y=weekdays_in_year,
            z=data,
            text=text,
            hoverinfo='text+z',
            xgap=3, # this
            ygap=3, # and this is used to make the grid-like apperance
            showscale=False,
            colorscale=colorscale
        )
    ]
    
        
    if month_lines:
        kwargs = dict(
            mode='lines',
            line=dict(
                color='gray',
                width=1
            ),
            hoverinfo='skip'
            
        )
        for date, dow, wkn in zip(dates_in_year,
                                  weekdays_in_year,
                                  weeknumber_of_dates):
            if date.day == 1:
                data += [
                    go.Scatter(
                        x=[wkn-.5, wkn-.5],
                        y=[dow-.5, 6.5],
                        **kwargs
                    )
                ]
                if dow:
                    data += [
                    go.Scatter(
                        x=[wkn-.5, wkn+.5],
                        y=[dow-.5, dow - .5],
                        **kwargs
                    ),
                    go.Scatter(
                        x=[wkn+.5, wkn+.5],
                        y=[dow-.5, -.5],
                        **kwargs
                    )
                ]
                    
                    
    layout = go.Layout(
        title='CAQI in the last 3 years',
        height=250,
        yaxis=dict(
            showline=False, showgrid=False, zeroline=False,
            tickmode='array',
            ticktext=['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
            tickvals=[0, 1, 2, 3, 4, 5, 6],
            autorange="reversed"
        ),
        xaxis=dict(
            showline=False, showgrid=False, zeroline=False,
            tickmode='array',
            ticktext=month_names,
            tickvals=month_positions
        ),
        margin = dict(t=40),
        showlegend=False
    )

    if fig is None:
        fig = go.Figure(data=data, layout=layout)
        fig.update_layout(plot_bgcolor='rgb(242,242,242)', paper_bgcolor = 'rgb(242,242,242)')
    else:
        fig.add_traces(data, rows=[(row+1)]*len(data), cols=[1]*len(data))
        fig.update_layout(layout, plot_bgcolor='rgb(242,242,242)', paper_bgcolor = 'rgb(242,242,242)')
        fig.update_xaxes(layout['xaxis'])
        fig.update_yaxes(layout['yaxis'])
    
    return fig


def display_years(z, years):
    fig = make_subplots(rows=len(years), cols=1, subplot_titles=years)
    for i, year in enumerate(years):
        data = z[i*365 : (i+1)*365]
        display_year(data, year=year, fig=fig, row=i)
        fig.update_layout(height=250*len(years), width=1300)
        
    return fig
In [ ]:
palette = cycle(px.colors.sequential.Viridis)
df_graph = df[['timestamp_measured', 'CAQI']]
df2015 = df_graph[df_graph['timestamp_measured'].dt.year == 2015]
df2019 = df_graph[df_graph['timestamp_measured'].dt.year == 2019]
df2020 = df_graph[df_graph['timestamp_measured'].dt.year == 2020]
df2021 = df_graph[df_graph['timestamp_measured'].dt.year == 2021]

# chart
fig = make_subplots(rows=4, cols=2, 
                    specs=[[{"type": "bar"}, {"type": "scatter"}], [{"colspan": 2}, None], [{"colspan": 2}, None], [{'type':'indicator'}, {'type':'bar'}]],
                    column_widths=[0.4, 0.6], vertical_spacing=0.1, horizontal_spacing=0.1,
                    subplot_titles=("Mean CAQI per Day of Week", "Hourly CAQI Trend", "Daily CAQI Trend", "2020 vs 2021", "Worst day: 1st of January 2019","CAQI Hourly Value Counts"))

# Upper Left chart
df_day = df_graph.groupby([df_graph["timestamp_measured"].dt.weekday]).mean().reset_index().sort_values(by='CAQI', ascending = False)
values = list(range(7))
fig.add_trace(go.Bar(x=df_day["timestamp_measured"], y=df_day['CAQI'], marker = dict(color=values, colorscale="Viridis"), 
                     name = 'Day of Week'),
                      row=1, col=1)

fig.update_xaxes(showgrid = False, linecolor='gray', linewidth = 2, zeroline = False, row=1, col=1)
fig.update_yaxes(showgrid = False, linecolor='gray',linewidth=2, zeroline = False, row=1, col=1)

# Upper Right chart
df_hour = df_graph.groupby([df_graph["timestamp_measured"].dt.hour]).mean().reset_index('timestamp_measured')
fig.add_trace(go.Scatter(x=df_hour["timestamp_measured"], y=df_hour['CAQI'], mode='lines+markers',
               name='Hourly CAQI'), row = 1, col = 2)

# Rectangle to highlight range
fig.add_vrect(x0=5, x1=12,
              fillcolor=px.colors.sequential.Viridis[4],
              layer="below", 
              opacity=0.25, 
              line_width=0, 
              row = 1, col = 2
)

fig.add_annotation(dict(
        x=7,
        y=df_hour.loc[8,'CAQI']+0.004,
        text="There is a <b>peak at <br>7am</b> coinciding with<br>going to work.",
        ax="-20",
        ay="-60",
        showarrow = True,
        arrowhead = 7,
        arrowwidth = 0.7
), row=1, col=2)

fig.add_annotation(dict(
        x=8.5,
        y=1.45,
        text="Morning hours are <br><b>the rush hours</b>.",
        showarrow = False
), row=1, col=2)

fig.add_annotation(dict(
        x=16,
        y=1.39,
        text="From 4pm <br> <b>CAQI<br> rises slightly again</b>.",
        ax="0",
        ay="-100",
        showarrow = True,
        arrowhead = 7,
        arrowwidth = 0.7
), row=1, col=2)

fig.update_xaxes(showgrid = False, linecolor='gray', linewidth = 2, zeroline = False, row=1, col=2)
fig.update_yaxes(showgrid = False, linecolor='gray', linewidth=2, row=1, col=2)

# Medium Chart
df_week = df_graph.groupby([df_graph["timestamp_measured"].dt.dayofyear]).mean().reset_index()
fig.add_trace(go.Scatter(x = df_week["timestamp_measured"], y = df_week['CAQI'], mode='lines',
                        marker = dict(color = px.colors.sequential.Viridis[5]),
                        name='Daily CAQI'), row = 2, col = 1)

from statsmodels.tsa.seasonal import seasonal_decompose
decomp = seasonal_decompose(df_week['CAQI'], model='additive', freq = 21)

fig.add_trace(go.Scatter(x = df_week["timestamp_measured"], y = decomp.trend, mode='lines',
                       marker = dict(color = medium),
                        name='CAQI Trend'), row = 2, col = 1)
    
fig.update_xaxes(showgrid = False, linecolor='gray', linewidth = 2, row=2, col=1)
fig.update_yaxes(gridcolor = 'gray', gridwidth = 0.15, linecolor='gray',linewidth=2, row=2, col=1)


df_week2015= df2015.groupby([df2015["timestamp_measured"].dt.dayofyear]).mean().reset_index()
fig.add_trace(go.Scatter(x = df_week2015["timestamp_measured"], y = df_week2015['CAQI'], mode='lines',
                         marker = dict(color = px.colors.sequential.Viridis[5]),
                         name='2015'), row = 3, col = 1)


df_week2021 = df2021.groupby([df2021["timestamp_measured"].dt.dayofyear]).mean().reset_index()
fig.add_trace(go.Scatter(x = df_week2021["timestamp_measured"], y = df_week2021['CAQI'], mode='lines',
                        marker = dict(color = px.colors.sequential.Viridis[8]),
                        name='2021'), row = 3, col = 1)

# Left Bottom Chart
fig.add_trace(go.Indicator(mode = "number", value = 537, title = 'The first hours of New Year always have bad air quality ', number = {'prefix': "PM10 "},), row = 4, col = 1)

# Right Bottom Chart
counts = df_graph['CAQI'].value_counts(ascending=False)
fig.add_trace(go.Bar(x=counts, y=['Very Low', 'Low', 'Medium', 'High', 'Very High'], marker = dict(color=colors), name = 'CAQI Values', orientation = 'h'),
                      row=4, col=2)

fig.update_xaxes(showgrid = False, linecolor='gray', linewidth = 2, zeroline = False, row=3, col=2)
fig.update_yaxes(showgrid = False, linecolor='gray',linewidth=2, zeroline = False, row=3, col=2)

fig.add_annotation(dict(
        x=33+0.15,
        y='Very High',
        text="Highest CAQI <br> are <b> more unusual</b>.",
        ax="110",
        ay="-20",
        showarrow = True,
        arrowhead = 7,
        arrowwidth = 0.7
), row=4, col=2)

# General Styling
fig.update_layout(height=1300, width=1300, bargap=0.2,
                  margin=dict(b=50,r=30,l=100),
                  title = "<span style='font-size:36px; font-family:Times New Roman'>CAQI Analysis</span>",                  
                  plot_bgcolor='rgb(242,242,242)',
                  paper_bgcolor = 'rgb(242,242,242)',
                  font=dict(family="Times New Roman", size= 14),
                  hoverlabel=dict(font_color="floralwhite"),
                  showlegend=False)
fig.show()

df20 = df_graph[df_graph['timestamp_measured'].dt.year >= 2019]
z = df20.groupby([df20["timestamp_measured"].dt.date])['CAQI'].mean()
display_years(z, (2019, 2020, 2021))

These plots are already really informative, but let's point out the main findings:

  1. There is a clear increase in the CAQI value from 5am to 12am, with a peak at 7am. We assume this is due to the morning rush hours, where everyone takes the car. Traffic is therefore and presumably a really big indicator of pollution.
  2. Pollution seems to decrease during Summer and increase during Winter. This also makes sense, as with colder climate people tend to take the car more often.
  3. 2021 had lower pollution average rates than 2015. This matches the trend that we showed before, but it could also be impacted by the COVID-19 restrictions.
  4. There are not that many really bad hours (with CAQI value of 5) throughout the year (0.046%) and also not that many bad hours (CAQI == 4, 0.676%).
  5. Most days seem to have quite a low CAQI average (lower than 1.5), but there are specific weeks or periods of time (rarely isolated) where these averages seem to go up signficantly. These increases seem to be reduced to the first trimetre of the year.

Modelling

Data split

For this specific challenge, there is an element that we must take into account:

COVID-19

Throughout the world, the outbreak of the pandemic already lowered the amount of traffic significantly. In the specific case of the Netherlands, at the end of 2020, the Dutch government first introduced a strict lockdown throughout the entire country, following a rapid rise in COVID-19 cases. This clearly had an impact in the traffic and therefore also in the pollution levels.

In order to try to minimize the impact of this pandemic in our model, we have decided to train over the dataset from 2014-2019 and validate over 2020, excluding 2021. Most countries had restrictions in place over 2021, but the Netherlands seemed to be less proactive in this timeframe and only introduced major restrictions during late 2020-2021.

In [ ]:
train_df = df[df["timestamp_measured"].dt.year < 2020]
test_df = df[df["timestamp_measured"].dt.year == 2020]
train_df.head()
Out[ ]:
component_id timestamp_measured C6H6 C7H8 FN NO NO2 PM10 PM25 PM25_CAQI PM10_CAQI NO2_CAQI CAQI
1 2014-01-01 01:00:00+00:00 1.21 1.41 2.38 30.0 42.0 90.3 74.7 4 4 1 4
2 2014-01-01 02:00:00+00:00 0.97 1.65 2.55 28.0 50.0 97.3 84.0 4 4 1 4
3 2014-01-01 03:00:00+00:00 1.11 1.98 2.50 24.0 48.0 41.6 34.7 3 2 1 3
4 2014-01-01 04:00:00+00:00 1.04 2.31 2.18 19.0 45.0 28.1 20.6 2 2 1 2
5 2014-01-01 05:00:00+00:00 0.58 1.05 1.52 20.0 40.0 17.1 15.6 2 1 1 2

We are setting the targets of our model to be the three pollutants that we use to compute the CAQI

In [ ]:
targets = ['NO2', 'PM10', 'PM25', 'PM25_CAQI', 'PM10_CAQI', 'NO2_CAQI', 'CAQI']

X_train = train_df.copy()
X_train = X_train.drop(['timestamp_measured'], axis=1)
Y_train = X_train['CAQI']
X_train = X_train.drop(targets, axis=1)

X_test = test_df.copy()
X_test = X_test.drop(['timestamp_measured'], axis=1)
Y_test = X_test['CAQI']
X_test = X_test.drop(targets, axis=1)

Baseline model

Following the best ML practices, we will first develop a simple baseline model that we can then compare against. We will use a simple XGBoost model trained over the basic dataset.

In [ ]:
clf = xgb.XGBClassifier()
clf.fit(X_train, Y_train)
xgb.plot_importance(clf)

preds = clf.predict(X_test)
print(accuracy_score(Y_test, preds))
0.8359330524877604
In [ ]:
train_pool = Pool(X_train, Y_train)
test_pool = Pool(X_test) 

model = CatBoostClassifier()
model.fit(train_pool)

preds = model.predict(test_pool)
print(accuracy_score(Y_test, preds))
Learning rate set to 0.096808
0:	learn: 1.4285394	total: 200ms	remaining: 3m 19s
1:	learn: 1.3002779	total: 289ms	remaining: 2m 24s
2:	learn: 1.2030663	total: 363ms	remaining: 2m
3:	learn: 1.1258058	total: 453ms	remaining: 1m 52s
4:	learn: 1.0616969	total: 505ms	remaining: 1m 40s
5:	learn: 1.0093255	total: 555ms	remaining: 1m 31s
6:	learn: 0.9643323	total: 629ms	remaining: 1m 29s
7:	learn: 0.9253930	total: 706ms	remaining: 1m 27s
8:	learn: 0.8917320	total: 754ms	remaining: 1m 23s
9:	learn: 0.8623465	total: 831ms	remaining: 1m 22s
10:	learn: 0.8368387	total: 901ms	remaining: 1m 20s
11:	learn: 0.8143511	total: 984ms	remaining: 1m 20s
12:	learn: 0.7952397	total: 1.05s	remaining: 1m 19s
13:	learn: 0.7775390	total: 1.12s	remaining: 1m 19s
14:	learn: 0.7627839	total: 1.21s	remaining: 1m 19s
15:	learn: 0.7491061	total: 1.31s	remaining: 1m 20s
16:	learn: 0.7370949	total: 1.41s	remaining: 1m 21s
17:	learn: 0.7269676	total: 1.52s	remaining: 1m 23s
18:	learn: 0.7171518	total: 1.59s	remaining: 1m 22s
19:	learn: 0.7078058	total: 1.63s	remaining: 1m 19s
20:	learn: 0.6999673	total: 1.69s	remaining: 1m 18s
21:	learn: 0.6927360	total: 1.76s	remaining: 1m 18s
22:	learn: 0.6860965	total: 1.83s	remaining: 1m 17s
23:	learn: 0.6800649	total: 1.92s	remaining: 1m 17s
24:	learn: 0.6747969	total: 1.98s	remaining: 1m 17s
25:	learn: 0.6699509	total: 2.06s	remaining: 1m 17s
26:	learn: 0.6657008	total: 2.1s	remaining: 1m 15s
27:	learn: 0.6615224	total: 2.15s	remaining: 1m 14s
28:	learn: 0.6576613	total: 2.22s	remaining: 1m 14s
29:	learn: 0.6543509	total: 2.29s	remaining: 1m 14s
30:	learn: 0.6516660	total: 2.35s	remaining: 1m 13s
31:	learn: 0.6488602	total: 2.43s	remaining: 1m 13s
32:	learn: 0.6466435	total: 2.51s	remaining: 1m 13s
33:	learn: 0.6443189	total: 2.58s	remaining: 1m 13s
34:	learn: 0.6419116	total: 2.64s	remaining: 1m 12s
35:	learn: 0.6399431	total: 2.68s	remaining: 1m 11s
36:	learn: 0.6381529	total: 2.73s	remaining: 1m 10s
37:	learn: 0.6364387	total: 2.79s	remaining: 1m 10s
38:	learn: 0.6350124	total: 2.86s	remaining: 1m 10s
39:	learn: 0.6334598	total: 2.93s	remaining: 1m 10s
40:	learn: 0.6321568	total: 3s	remaining: 1m 10s
41:	learn: 0.6310611	total: 3.06s	remaining: 1m 9s
42:	learn: 0.6298958	total: 3.13s	remaining: 1m 9s
43:	learn: 0.6286279	total: 3.22s	remaining: 1m 9s
44:	learn: 0.6275607	total: 3.27s	remaining: 1m 9s
45:	learn: 0.6265520	total: 3.34s	remaining: 1m 9s
46:	learn: 0.6255964	total: 3.4s	remaining: 1m 9s
47:	learn: 0.6246424	total: 3.48s	remaining: 1m 9s
48:	learn: 0.6238775	total: 3.56s	remaining: 1m 9s
49:	learn: 0.6232690	total: 3.62s	remaining: 1m 8s
50:	learn: 0.6227596	total: 3.7s	remaining: 1m 8s
51:	learn: 0.6220259	total: 3.77s	remaining: 1m 8s
52:	learn: 0.6213352	total: 3.84s	remaining: 1m 8s
53:	learn: 0.6206181	total: 3.91s	remaining: 1m 8s
54:	learn: 0.6202372	total: 3.95s	remaining: 1m 7s
55:	learn: 0.6196940	total: 4.01s	remaining: 1m 7s
56:	learn: 0.6192901	total: 4.11s	remaining: 1m 8s
57:	learn: 0.6186310	total: 4.17s	remaining: 1m 7s
58:	learn: 0.6179959	total: 4.25s	remaining: 1m 7s
59:	learn: 0.6175650	total: 4.29s	remaining: 1m 7s
60:	learn: 0.6171659	total: 4.33s	remaining: 1m 6s
61:	learn: 0.6167771	total: 4.37s	remaining: 1m 6s
62:	learn: 0.6163937	total: 4.45s	remaining: 1m 6s
63:	learn: 0.6160944	total: 4.52s	remaining: 1m 6s
64:	learn: 0.6157103	total: 4.56s	remaining: 1m 5s
65:	learn: 0.6153599	total: 4.65s	remaining: 1m 5s
66:	learn: 0.6149382	total: 4.7s	remaining: 1m 5s
67:	learn: 0.6145585	total: 4.74s	remaining: 1m 4s
68:	learn: 0.6141871	total: 4.8s	remaining: 1m 4s
69:	learn: 0.6138747	total: 4.83s	remaining: 1m 4s
70:	learn: 0.6136369	total: 4.86s	remaining: 1m 3s
71:	learn: 0.6134357	total: 4.88s	remaining: 1m 2s
72:	learn: 0.6131627	total: 4.92s	remaining: 1m 2s
73:	learn: 0.6128139	total: 4.95s	remaining: 1m 1s
74:	learn: 0.6124757	total: 4.98s	remaining: 1m 1s
75:	learn: 0.6121227	total: 5.01s	remaining: 1m
76:	learn: 0.6118503	total: 5.03s	remaining: 1m
77:	learn: 0.6116041	total: 5.06s	remaining: 59.8s
78:	learn: 0.6113530	total: 5.09s	remaining: 59.3s
79:	learn: 0.6110042	total: 5.13s	remaining: 59s
80:	learn: 0.6107979	total: 5.15s	remaining: 58.5s
81:	learn: 0.6105677	total: 5.18s	remaining: 58s
82:	learn: 0.6103122	total: 5.21s	remaining: 57.6s
83:	learn: 0.6101654	total: 5.24s	remaining: 57.2s
84:	learn: 0.6099015	total: 5.27s	remaining: 56.7s
85:	learn: 0.6096887	total: 5.3s	remaining: 56.3s
86:	learn: 0.6094987	total: 5.32s	remaining: 55.9s
87:	learn: 0.6092339	total: 5.36s	remaining: 55.6s
88:	learn: 0.6089783	total: 5.39s	remaining: 55.2s
89:	learn: 0.6087390	total: 5.42s	remaining: 54.8s
90:	learn: 0.6084959	total: 5.45s	remaining: 54.4s
91:	learn: 0.6083109	total: 5.48s	remaining: 54.1s
92:	learn: 0.6081878	total: 5.52s	remaining: 53.9s
93:	learn: 0.6079516	total: 5.55s	remaining: 53.5s
94:	learn: 0.6076658	total: 5.58s	remaining: 53.2s
95:	learn: 0.6074724	total: 5.62s	remaining: 52.9s
96:	learn: 0.6072663	total: 5.65s	remaining: 52.6s
97:	learn: 0.6070770	total: 5.68s	remaining: 52.3s
98:	learn: 0.6067736	total: 5.71s	remaining: 52s
99:	learn: 0.6065662	total: 5.74s	remaining: 51.6s
100:	learn: 0.6063503	total: 5.77s	remaining: 51.3s
101:	learn: 0.6061779	total: 5.8s	remaining: 51.1s
102:	learn: 0.6060105	total: 5.83s	remaining: 50.8s
103:	learn: 0.6058162	total: 5.86s	remaining: 50.5s
104:	learn: 0.6056216	total: 5.89s	remaining: 50.2s
105:	learn: 0.6054180	total: 5.93s	remaining: 50s
106:	learn: 0.6052625	total: 5.96s	remaining: 49.7s
107:	learn: 0.6050889	total: 5.99s	remaining: 49.4s
108:	learn: 0.6049561	total: 6.02s	remaining: 49.2s
109:	learn: 0.6048101	total: 6.05s	remaining: 48.9s
110:	learn: 0.6046921	total: 6.08s	remaining: 48.7s
111:	learn: 0.6044998	total: 6.1s	remaining: 48.4s
112:	learn: 0.6042895	total: 6.13s	remaining: 48.1s
113:	learn: 0.6041415	total: 6.16s	remaining: 47.9s
114:	learn: 0.6040068	total: 6.19s	remaining: 47.6s
115:	learn: 0.6037819	total: 6.22s	remaining: 47.4s
116:	learn: 0.6035871	total: 6.25s	remaining: 47.2s
117:	learn: 0.6033989	total: 6.28s	remaining: 46.9s
118:	learn: 0.6031892	total: 6.3s	remaining: 46.7s
119:	learn: 0.6030457	total: 6.33s	remaining: 46.4s
120:	learn: 0.6028734	total: 6.36s	remaining: 46.2s
121:	learn: 0.6027198	total: 6.39s	remaining: 46s
122:	learn: 0.6026121	total: 6.42s	remaining: 45.8s
123:	learn: 0.6024604	total: 6.46s	remaining: 45.6s
124:	learn: 0.6023160	total: 6.48s	remaining: 45.4s
125:	learn: 0.6021489	total: 6.53s	remaining: 45.3s
126:	learn: 0.6019994	total: 6.56s	remaining: 45.1s
127:	learn: 0.6018712	total: 6.58s	remaining: 44.8s
128:	learn: 0.6017456	total: 6.61s	remaining: 44.7s
129:	learn: 0.6015971	total: 6.64s	remaining: 44.4s
130:	learn: 0.6014178	total: 6.68s	remaining: 44.3s
131:	learn: 0.6012850	total: 6.71s	remaining: 44.1s
132:	learn: 0.6011459	total: 6.73s	remaining: 43.9s
133:	learn: 0.6009389	total: 6.76s	remaining: 43.7s
134:	learn: 0.6007390	total: 6.79s	remaining: 43.5s
135:	learn: 0.6005858	total: 6.82s	remaining: 43.3s
136:	learn: 0.6004413	total: 6.85s	remaining: 43.1s
137:	learn: 0.6002048	total: 6.88s	remaining: 43s
138:	learn: 0.6000397	total: 6.91s	remaining: 42.8s
139:	learn: 0.5999373	total: 6.94s	remaining: 42.6s
140:	learn: 0.5997612	total: 6.97s	remaining: 42.4s
141:	learn: 0.5995241	total: 6.99s	remaining: 42.3s
142:	learn: 0.5993932	total: 7.03s	remaining: 42.1s
143:	learn: 0.5992568	total: 7.05s	remaining: 41.9s
144:	learn: 0.5991574	total: 7.08s	remaining: 41.8s
145:	learn: 0.5990657	total: 7.11s	remaining: 41.6s
146:	learn: 0.5988795	total: 7.14s	remaining: 41.4s
147:	learn: 0.5988011	total: 7.17s	remaining: 41.3s
148:	learn: 0.5986950	total: 7.19s	remaining: 41.1s
149:	learn: 0.5985629	total: 7.22s	remaining: 40.9s
150:	learn: 0.5983792	total: 7.25s	remaining: 40.8s
151:	learn: 0.5982456	total: 7.28s	remaining: 40.6s
152:	learn: 0.5981150	total: 7.31s	remaining: 40.5s
153:	learn: 0.5979402	total: 7.34s	remaining: 40.4s
154:	learn: 0.5978368	total: 7.38s	remaining: 40.2s
155:	learn: 0.5976697	total: 7.4s	remaining: 40.1s
156:	learn: 0.5975394	total: 7.43s	remaining: 39.9s
157:	learn: 0.5973856	total: 7.46s	remaining: 39.8s
158:	learn: 0.5972361	total: 7.49s	remaining: 39.6s
159:	learn: 0.5971407	total: 7.52s	remaining: 39.5s
160:	learn: 0.5970289	total: 7.56s	remaining: 39.4s
161:	learn: 0.5969416	total: 7.58s	remaining: 39.2s
162:	learn: 0.5968493	total: 7.61s	remaining: 39.1s
163:	learn: 0.5967455	total: 7.64s	remaining: 38.9s
164:	learn: 0.5966083	total: 7.67s	remaining: 38.8s
165:	learn: 0.5965075	total: 7.69s	remaining: 38.6s
166:	learn: 0.5963305	total: 7.72s	remaining: 38.5s
167:	learn: 0.5962175	total: 7.75s	remaining: 38.4s
168:	learn: 0.5960876	total: 7.78s	remaining: 38.3s
169:	learn: 0.5959511	total: 7.82s	remaining: 38.2s
170:	learn: 0.5958260	total: 7.84s	remaining: 38s
171:	learn: 0.5957069	total: 7.87s	remaining: 37.9s
172:	learn: 0.5956386	total: 7.9s	remaining: 37.8s
173:	learn: 0.5955091	total: 7.96s	remaining: 37.8s
174:	learn: 0.5953939	total: 7.99s	remaining: 37.7s
175:	learn: 0.5952664	total: 8.02s	remaining: 37.5s
176:	learn: 0.5951140	total: 8.05s	remaining: 37.4s
177:	learn: 0.5949727	total: 8.08s	remaining: 37.3s
178:	learn: 0.5948372	total: 8.11s	remaining: 37.2s
179:	learn: 0.5947314	total: 8.13s	remaining: 37.1s
180:	learn: 0.5945985	total: 8.16s	remaining: 36.9s
181:	learn: 0.5944477	total: 8.19s	remaining: 36.8s
182:	learn: 0.5942943	total: 8.23s	remaining: 36.7s
183:	learn: 0.5941788	total: 8.25s	remaining: 36.6s
184:	learn: 0.5940826	total: 8.28s	remaining: 36.5s
185:	learn: 0.5939283	total: 8.31s	remaining: 36.4s
186:	learn: 0.5938148	total: 8.34s	remaining: 36.3s
187:	learn: 0.5937355	total: 8.37s	remaining: 36.1s
188:	learn: 0.5936538	total: 8.39s	remaining: 36s
189:	learn: 0.5935388	total: 8.43s	remaining: 35.9s
190:	learn: 0.5934278	total: 8.45s	remaining: 35.8s
191:	learn: 0.5932033	total: 8.5s	remaining: 35.8s
192:	learn: 0.5931312	total: 8.54s	remaining: 35.7s
193:	learn: 0.5930367	total: 8.57s	remaining: 35.6s
194:	learn: 0.5929334	total: 8.6s	remaining: 35.5s
195:	learn: 0.5928486	total: 8.63s	remaining: 35.4s
196:	learn: 0.5927471	total: 8.66s	remaining: 35.3s
197:	learn: 0.5926564	total: 8.69s	remaining: 35.2s
198:	learn: 0.5925476	total: 8.73s	remaining: 35.1s
199:	learn: 0.5924598	total: 8.8s	remaining: 35.2s
200:	learn: 0.5923578	total: 8.87s	remaining: 35.3s
201:	learn: 0.5922859	total: 8.95s	remaining: 35.3s
202:	learn: 0.5922137	total: 9.03s	remaining: 35.4s
203:	learn: 0.5921569	total: 9.13s	remaining: 35.6s
204:	learn: 0.5920496	total: 9.24s	remaining: 35.8s
205:	learn: 0.5919741	total: 9.31s	remaining: 35.9s
206:	learn: 0.5918525	total: 9.38s	remaining: 36s
207:	learn: 0.5917746	total: 9.45s	remaining: 36s
208:	learn: 0.5916997	total: 9.51s	remaining: 36s
209:	learn: 0.5916106	total: 9.6s	remaining: 36.1s
210:	learn: 0.5915433	total: 9.68s	remaining: 36.2s
211:	learn: 0.5914563	total: 9.75s	remaining: 36.2s
212:	learn: 0.5913261	total: 9.82s	remaining: 36.3s
213:	learn: 0.5912194	total: 9.9s	remaining: 36.4s
214:	learn: 0.5911239	total: 9.98s	remaining: 36.5s
215:	learn: 0.5909678	total: 10.1s	remaining: 36.5s
216:	learn: 0.5908627	total: 10.2s	remaining: 36.6s
217:	learn: 0.5907329	total: 10.2s	remaining: 36.7s
218:	learn: 0.5905992	total: 10.3s	remaining: 36.8s
219:	learn: 0.5905052	total: 10.4s	remaining: 36.9s
220:	learn: 0.5902978	total: 10.5s	remaining: 37.1s
221:	learn: 0.5901870	total: 10.6s	remaining: 37.2s
222:	learn: 0.5900954	total: 10.7s	remaining: 37.3s
223:	learn: 0.5900062	total: 10.8s	remaining: 37.3s
224:	learn: 0.5898700	total: 10.8s	remaining: 37.4s
225:	learn: 0.5897482	total: 10.9s	remaining: 37.4s
226:	learn: 0.5896177	total: 11s	remaining: 37.4s
227:	learn: 0.5895534	total: 11.1s	remaining: 37.5s
228:	learn: 0.5894585	total: 11.2s	remaining: 37.6s
229:	learn: 0.5893328	total: 11.2s	remaining: 37.6s
230:	learn: 0.5892583	total: 11.3s	remaining: 37.6s
231:	learn: 0.5890865	total: 11.4s	remaining: 37.6s
232:	learn: 0.5889820	total: 11.4s	remaining: 37.6s
233:	learn: 0.5889033	total: 11.5s	remaining: 37.7s
234:	learn: 0.5887723	total: 11.6s	remaining: 37.6s
235:	learn: 0.5886099	total: 11.6s	remaining: 37.6s
236:	learn: 0.5884840	total: 11.7s	remaining: 37.8s
237:	learn: 0.5883719	total: 11.8s	remaining: 37.8s
238:	learn: 0.5882792	total: 11.9s	remaining: 37.8s
239:	learn: 0.5881795	total: 11.9s	remaining: 37.8s
240:	learn: 0.5881003	total: 12s	remaining: 37.8s
241:	learn: 0.5879412	total: 12.1s	remaining: 37.8s
242:	learn: 0.5878011	total: 12.1s	remaining: 37.8s
243:	learn: 0.5877303	total: 12.2s	remaining: 37.7s
244:	learn: 0.5876212	total: 12.2s	remaining: 37.6s
245:	learn: 0.5875284	total: 12.3s	remaining: 37.5s
246:	learn: 0.5873635	total: 12.3s	remaining: 37.5s
247:	learn: 0.5872270	total: 12.3s	remaining: 37.4s
248:	learn: 0.5871218	total: 12.4s	remaining: 37.4s
249:	learn: 0.5870251	total: 12.5s	remaining: 37.4s
250:	learn: 0.5869172	total: 12.5s	remaining: 37.3s
251:	learn: 0.5868178	total: 12.6s	remaining: 37.4s
252:	learn: 0.5866969	total: 12.7s	remaining: 37.4s
253:	learn: 0.5866150	total: 12.7s	remaining: 37.4s
254:	learn: 0.5864998	total: 12.8s	remaining: 37.3s
255:	learn: 0.5863993	total: 12.8s	remaining: 37.3s
256:	learn: 0.5862872	total: 12.9s	remaining: 37.4s
257:	learn: 0.5861766	total: 13.1s	remaining: 37.5s
258:	learn: 0.5860024	total: 13.1s	remaining: 37.6s
259:	learn: 0.5859480	total: 13.3s	remaining: 37.7s
260:	learn: 0.5858822	total: 13.3s	remaining: 37.8s
261:	learn: 0.5857209	total: 13.4s	remaining: 37.8s
262:	learn: 0.5856211	total: 13.5s	remaining: 37.8s
263:	learn: 0.5855620	total: 13.6s	remaining: 37.8s
264:	learn: 0.5854623	total: 13.7s	remaining: 38s
265:	learn: 0.5853805	total: 13.8s	remaining: 38.1s
266:	learn: 0.5852833	total: 13.9s	remaining: 38.1s
267:	learn: 0.5851593	total: 14s	remaining: 38.1s
268:	learn: 0.5850394	total: 14s	remaining: 38.1s
269:	learn: 0.5849837	total: 14.1s	remaining: 38.1s
270:	learn: 0.5849130	total: 14.2s	remaining: 38.1s
271:	learn: 0.5848261	total: 14.2s	remaining: 38.1s
272:	learn: 0.5847593	total: 14.3s	remaining: 38.1s
273:	learn: 0.5847065	total: 14.4s	remaining: 38.1s
274:	learn: 0.5846337	total: 14.5s	remaining: 38.1s
275:	learn: 0.5845672	total: 14.5s	remaining: 38.1s
276:	learn: 0.5845157	total: 14.6s	remaining: 38.2s
277:	learn: 0.5844362	total: 14.7s	remaining: 38.1s
278:	learn: 0.5843766	total: 14.7s	remaining: 38s
279:	learn: 0.5843189	total: 14.8s	remaining: 38s
280:	learn: 0.5842524	total: 14.8s	remaining: 37.9s
281:	learn: 0.5841660	total: 14.9s	remaining: 37.9s
282:	learn: 0.5840732	total: 15s	remaining: 37.9s
283:	learn: 0.5840008	total: 15s	remaining: 37.9s
284:	learn: 0.5839423	total: 15.1s	remaining: 37.9s
285:	learn: 0.5838489	total: 15.2s	remaining: 37.9s
286:	learn: 0.5837887	total: 15.2s	remaining: 37.9s
287:	learn: 0.5836868	total: 15.4s	remaining: 38s
288:	learn: 0.5835213	total: 15.5s	remaining: 38.1s
289:	learn: 0.5834552	total: 15.5s	remaining: 38.1s
290:	learn: 0.5833445	total: 15.6s	remaining: 38.1s
291:	learn: 0.5832517	total: 15.7s	remaining: 38.1s
292:	learn: 0.5831739	total: 15.8s	remaining: 38.1s
293:	learn: 0.5830703	total: 15.8s	remaining: 38s
294:	learn: 0.5829890	total: 15.9s	remaining: 37.9s
295:	learn: 0.5829146	total: 16s	remaining: 37.9s
296:	learn: 0.5828124	total: 16s	remaining: 37.9s
297:	learn: 0.5827469	total: 16.1s	remaining: 37.9s
298:	learn: 0.5826628	total: 16.1s	remaining: 37.8s
299:	learn: 0.5825806	total: 16.2s	remaining: 37.8s
300:	learn: 0.5825027	total: 16.3s	remaining: 37.8s
301:	learn: 0.5824704	total: 16.3s	remaining: 37.7s
302:	learn: 0.5824111	total: 16.4s	remaining: 37.7s
303:	learn: 0.5823328	total: 16.5s	remaining: 37.7s
304:	learn: 0.5822507	total: 16.5s	remaining: 37.7s
305:	learn: 0.5821674	total: 16.6s	remaining: 37.7s
306:	learn: 0.5821239	total: 16.7s	remaining: 37.6s
307:	learn: 0.5820482	total: 16.7s	remaining: 37.6s
308:	learn: 0.5820113	total: 16.8s	remaining: 37.5s
309:	learn: 0.5819244	total: 16.8s	remaining: 37.4s
310:	learn: 0.5818830	total: 16.8s	remaining: 37.3s
311:	learn: 0.5818058	total: 16.9s	remaining: 37.3s
312:	learn: 0.5817435	total: 17s	remaining: 37.2s
313:	learn: 0.5816486	total: 17s	remaining: 37.2s
314:	learn: 0.5815937	total: 17.1s	remaining: 37.2s
315:	learn: 0.5815053	total: 17.1s	remaining: 37.1s
316:	learn: 0.5814419	total: 17.2s	remaining: 37.1s
317:	learn: 0.5813821	total: 17.3s	remaining: 37.1s
318:	learn: 0.5813209	total: 17.4s	remaining: 37.1s
319:	learn: 0.5812316	total: 17.4s	remaining: 37s
320:	learn: 0.5811688	total: 17.5s	remaining: 37s
321:	learn: 0.5811039	total: 17.6s	remaining: 37s
322:	learn: 0.5810499	total: 17.7s	remaining: 37s
323:	learn: 0.5809467	total: 17.8s	remaining: 37s
324:	learn: 0.5808856	total: 17.8s	remaining: 37s
325:	learn: 0.5808166	total: 17.9s	remaining: 37s
326:	learn: 0.5807530	total: 18s	remaining: 37s
327:	learn: 0.5806386	total: 18s	remaining: 37s
328:	learn: 0.5805774	total: 18.1s	remaining: 37s
329:	learn: 0.5805051	total: 18.2s	remaining: 36.9s
330:	learn: 0.5803755	total: 18.3s	remaining: 36.9s
331:	learn: 0.5802905	total: 18.4s	remaining: 36.9s
332:	learn: 0.5802111	total: 18.4s	remaining: 36.8s
333:	learn: 0.5801714	total: 18.4s	remaining: 36.7s
334:	learn: 0.5800729	total: 18.5s	remaining: 36.7s
335:	learn: 0.5799961	total: 18.6s	remaining: 36.7s
336:	learn: 0.5798969	total: 18.6s	remaining: 36.6s
337:	learn: 0.5798422	total: 18.7s	remaining: 36.7s
338:	learn: 0.5797520	total: 18.8s	remaining: 36.6s
339:	learn: 0.5796864	total: 18.8s	remaining: 36.6s
340:	learn: 0.5795824	total: 18.9s	remaining: 36.5s
341:	learn: 0.5795185	total: 18.9s	remaining: 36.4s
342:	learn: 0.5794798	total: 19s	remaining: 36.4s
343:	learn: 0.5794332	total: 19.1s	remaining: 36.4s
344:	learn: 0.5793154	total: 19.1s	remaining: 36.4s
345:	learn: 0.5792209	total: 19.2s	remaining: 36.3s
346:	learn: 0.5791392	total: 19.3s	remaining: 36.2s
347:	learn: 0.5790789	total: 19.3s	remaining: 36.2s
348:	learn: 0.5789634	total: 19.4s	remaining: 36.2s
349:	learn: 0.5789004	total: 19.5s	remaining: 36.2s
350:	learn: 0.5788397	total: 19.5s	remaining: 36.1s
351:	learn: 0.5786914	total: 19.6s	remaining: 36.1s
352:	learn: 0.5785921	total: 19.7s	remaining: 36.1s
353:	learn: 0.5784790	total: 19.8s	remaining: 36.2s
354:	learn: 0.5784115	total: 19.9s	remaining: 36.1s
355:	learn: 0.5783512	total: 19.9s	remaining: 36.1s
356:	learn: 0.5782543	total: 20s	remaining: 36s
357:	learn: 0.5781734	total: 20.1s	remaining: 36s
358:	learn: 0.5780994	total: 20.2s	remaining: 36s
359:	learn: 0.5780204	total: 20.2s	remaining: 36s
360:	learn: 0.5779722	total: 20.3s	remaining: 35.9s
361:	learn: 0.5778908	total: 20.4s	remaining: 35.9s
362:	learn: 0.5777949	total: 20.5s	remaining: 35.9s
363:	learn: 0.5777021	total: 20.5s	remaining: 35.9s
364:	learn: 0.5776269	total: 20.6s	remaining: 35.8s
365:	learn: 0.5775687	total: 20.6s	remaining: 35.8s
366:	learn: 0.5775124	total: 20.7s	remaining: 35.7s
367:	learn: 0.5774641	total: 20.8s	remaining: 35.7s
368:	learn: 0.5773831	total: 20.8s	remaining: 35.6s
369:	learn: 0.5773391	total: 20.9s	remaining: 35.6s
370:	learn: 0.5772841	total: 21s	remaining: 35.5s
371:	learn: 0.5772268	total: 21.1s	remaining: 35.5s
372:	learn: 0.5771259	total: 21.1s	remaining: 35.5s
373:	learn: 0.5770758	total: 21.1s	remaining: 35.4s
374:	learn: 0.5769952	total: 21.2s	remaining: 35.4s
375:	learn: 0.5769217	total: 21.3s	remaining: 35.4s
376:	learn: 0.5768744	total: 21.4s	remaining: 35.3s
377:	learn: 0.5768053	total: 21.4s	remaining: 35.3s
378:	learn: 0.5767279	total: 21.5s	remaining: 35.2s
379:	learn: 0.5766721	total: 21.5s	remaining: 35.1s
380:	learn: 0.5766047	total: 21.6s	remaining: 35.1s
381:	learn: 0.5765174	total: 21.6s	remaining: 35s
382:	learn: 0.5764601	total: 21.7s	remaining: 35s
383:	learn: 0.5763980	total: 21.8s	remaining: 35s
384:	learn: 0.5762971	total: 21.9s	remaining: 34.9s
385:	learn: 0.5762348	total: 21.9s	remaining: 34.9s
386:	learn: 0.5761718	total: 22s	remaining: 34.8s
387:	learn: 0.5761001	total: 22.1s	remaining: 34.8s
388:	learn: 0.5759786	total: 22.1s	remaining: 34.7s
389:	learn: 0.5758555	total: 22.1s	remaining: 34.6s
390:	learn: 0.5757704	total: 22.2s	remaining: 34.6s
391:	learn: 0.5757068	total: 22.3s	remaining: 34.5s
392:	learn: 0.5755918	total: 22.3s	remaining: 34.5s
393:	learn: 0.5755287	total: 22.4s	remaining: 34.4s
394:	learn: 0.5754789	total: 22.4s	remaining: 34.4s
395:	learn: 0.5754182	total: 22.5s	remaining: 34.3s
396:	learn: 0.5753605	total: 22.5s	remaining: 34.2s
397:	learn: 0.5753321	total: 22.6s	remaining: 34.1s
398:	learn: 0.5752502	total: 22.6s	remaining: 34.1s
399:	learn: 0.5751590	total: 22.7s	remaining: 34.1s
400:	learn: 0.5750883	total: 22.8s	remaining: 34s
401:	learn: 0.5749770	total: 22.8s	remaining: 34s
402:	learn: 0.5748640	total: 22.9s	remaining: 33.9s
403:	learn: 0.5748122	total: 23s	remaining: 33.9s
404:	learn: 0.5747126	total: 23.1s	remaining: 33.9s
405:	learn: 0.5746567	total: 23.1s	remaining: 33.8s
406:	learn: 0.5745831	total: 23.2s	remaining: 33.8s
407:	learn: 0.5744725	total: 23.3s	remaining: 33.8s
408:	learn: 0.5744019	total: 23.3s	remaining: 33.7s
409:	learn: 0.5743030	total: 23.4s	remaining: 33.7s
410:	learn: 0.5742587	total: 23.5s	remaining: 33.6s
411:	learn: 0.5742076	total: 23.5s	remaining: 33.6s
412:	learn: 0.5741359	total: 23.6s	remaining: 33.5s
413:	learn: 0.5740879	total: 23.6s	remaining: 33.4s
414:	learn: 0.5740586	total: 23.7s	remaining: 33.4s
415:	learn: 0.5739608	total: 23.7s	remaining: 33.3s
416:	learn: 0.5738861	total: 23.8s	remaining: 33.2s
417:	learn: 0.5737970	total: 23.8s	remaining: 33.2s
418:	learn: 0.5737115	total: 23.9s	remaining: 33.1s
419:	learn: 0.5736272	total: 23.9s	remaining: 33s
420:	learn: 0.5735705	total: 24s	remaining: 33s
421:	learn: 0.5735156	total: 24.1s	remaining: 33s
422:	learn: 0.5733799	total: 24.1s	remaining: 32.9s
423:	learn: 0.5733149	total: 24.2s	remaining: 32.9s
424:	learn: 0.5732596	total: 24.2s	remaining: 32.8s
425:	learn: 0.5731747	total: 24.3s	remaining: 32.7s
426:	learn: 0.5731409	total: 24.3s	remaining: 32.6s
427:	learn: 0.5730745	total: 24.3s	remaining: 32.5s
428:	learn: 0.5730309	total: 24.3s	remaining: 32.4s
429:	learn: 0.5729467	total: 24.4s	remaining: 32.3s
430:	learn: 0.5728734	total: 24.4s	remaining: 32.2s
431:	learn: 0.5728305	total: 24.5s	remaining: 32.2s
432:	learn: 0.5727544	total: 24.5s	remaining: 32.1s
433:	learn: 0.5726347	total: 24.6s	remaining: 32.1s
434:	learn: 0.5725813	total: 24.6s	remaining: 32s
435:	learn: 0.5724939	total: 24.8s	remaining: 32s
436:	learn: 0.5724315	total: 24.8s	remaining: 32s
437:	learn: 0.5723778	total: 24.9s	remaining: 31.9s
438:	learn: 0.5723120	total: 25s	remaining: 31.9s
439:	learn: 0.5722516	total: 25s	remaining: 31.9s
440:	learn: 0.5721740	total: 25.1s	remaining: 31.8s
441:	learn: 0.5721208	total: 25.2s	remaining: 31.8s
442:	learn: 0.5720745	total: 25.2s	remaining: 31.7s
443:	learn: 0.5720360	total: 25.3s	remaining: 31.7s
444:	learn: 0.5719928	total: 25.4s	remaining: 31.6s
445:	learn: 0.5719269	total: 25.4s	remaining: 31.6s
446:	learn: 0.5718745	total: 25.5s	remaining: 31.6s
447:	learn: 0.5718048	total: 25.5s	remaining: 31.5s
448:	learn: 0.5717774	total: 25.6s	remaining: 31.4s
449:	learn: 0.5717373	total: 25.7s	remaining: 31.4s
450:	learn: 0.5716973	total: 25.7s	remaining: 31.3s
451:	learn: 0.5716192	total: 25.8s	remaining: 31.3s
452:	learn: 0.5715233	total: 25.9s	remaining: 31.2s
453:	learn: 0.5714791	total: 25.9s	remaining: 31.2s
454:	learn: 0.5714251	total: 26s	remaining: 31.2s
455:	learn: 0.5713323	total: 26.1s	remaining: 31.1s
456:	learn: 0.5712452	total: 26.1s	remaining: 31.1s
457:	learn: 0.5711803	total: 26.2s	remaining: 31s
458:	learn: 0.5711023	total: 26.3s	remaining: 31s
459:	learn: 0.5710404	total: 26.3s	remaining: 30.9s
460:	learn: 0.5710131	total: 26.4s	remaining: 30.9s
461:	learn: 0.5709522	total: 26.5s	remaining: 30.8s
462:	learn: 0.5708814	total: 26.6s	remaining: 30.8s
463:	learn: 0.5708247	total: 26.6s	remaining: 30.8s
464:	learn: 0.5707382	total: 26.7s	remaining: 30.7s
465:	learn: 0.5706825	total: 26.7s	remaining: 30.6s
466:	learn: 0.5706375	total: 26.8s	remaining: 30.6s
467:	learn: 0.5705865	total: 26.8s	remaining: 30.5s
468:	learn: 0.5705068	total: 26.9s	remaining: 30.5s
469:	learn: 0.5704742	total: 27s	remaining: 30.4s
470:	learn: 0.5704214	total: 27s	remaining: 30.4s
471:	learn: 0.5703647	total: 27.1s	remaining: 30.3s
472:	learn: 0.5702806	total: 27.2s	remaining: 30.3s
473:	learn: 0.5702326	total: 27.3s	remaining: 30.3s
474:	learn: 0.5701952	total: 27.3s	remaining: 30.2s
475:	learn: 0.5701175	total: 27.4s	remaining: 30.1s
476:	learn: 0.5700223	total: 27.4s	remaining: 30.1s
477:	learn: 0.5699325	total: 27.5s	remaining: 30s
478:	learn: 0.5698128	total: 27.5s	remaining: 30s
479:	learn: 0.5697079	total: 27.6s	remaining: 29.9s
480:	learn: 0.5695951	total: 27.7s	remaining: 29.9s
481:	learn: 0.5695301	total: 27.7s	remaining: 29.8s
482:	learn: 0.5694035	total: 27.8s	remaining: 29.7s
483:	learn: 0.5693049	total: 27.9s	remaining: 29.7s
484:	learn: 0.5692681	total: 27.9s	remaining: 29.7s
485:	learn: 0.5691988	total: 28s	remaining: 29.6s
486:	learn: 0.5691428	total: 28.1s	remaining: 29.6s
487:	learn: 0.5690905	total: 28.1s	remaining: 29.5s
488:	learn: 0.5690012	total: 28.2s	remaining: 29.5s
489:	learn: 0.5689414	total: 28.3s	remaining: 29.4s
490:	learn: 0.5689039	total: 28.3s	remaining: 29.4s
491:	learn: 0.5688386	total: 28.4s	remaining: 29.3s
492:	learn: 0.5687766	total: 28.5s	remaining: 29.3s
493:	learn: 0.5687019	total: 28.6s	remaining: 29.3s
494:	learn: 0.5686174	total: 28.6s	remaining: 29.2s
495:	learn: 0.5685552	total: 28.7s	remaining: 29.2s
496:	learn: 0.5685094	total: 28.8s	remaining: 29.1s
497:	learn: 0.5684364	total: 28.8s	remaining: 29.1s
498:	learn: 0.5683348	total: 28.9s	remaining: 29s
499:	learn: 0.5682508	total: 29s	remaining: 29s
500:	learn: 0.5681863	total: 29s	remaining: 28.9s
501:	learn: 0.5681335	total: 29.1s	remaining: 28.9s
502:	learn: 0.5680509	total: 29.2s	remaining: 28.8s
503:	learn: 0.5680033	total: 29.2s	remaining: 28.8s
504:	learn: 0.5679023	total: 29.3s	remaining: 28.7s
505:	learn: 0.5678622	total: 29.3s	remaining: 28.6s
506:	learn: 0.5677747	total: 29.4s	remaining: 28.6s
507:	learn: 0.5677177	total: 29.4s	remaining: 28.5s
508:	learn: 0.5676392	total: 29.5s	remaining: 28.4s
509:	learn: 0.5675920	total: 29.6s	remaining: 28.4s
510:	learn: 0.5675351	total: 29.6s	remaining: 28.4s
511:	learn: 0.5674398	total: 29.7s	remaining: 28.3s
512:	learn: 0.5673838	total: 29.8s	remaining: 28.3s
513:	learn: 0.5672955	total: 29.8s	remaining: 28.2s
514:	learn: 0.5672527	total: 29.9s	remaining: 28.2s
515:	learn: 0.5671527	total: 30s	remaining: 28.1s
516:	learn: 0.5670722	total: 30s	remaining: 28.1s
517:	learn: 0.5670151	total: 30.1s	remaining: 28s
518:	learn: 0.5669521	total: 30.2s	remaining: 28s
519:	learn: 0.5668891	total: 30.3s	remaining: 27.9s
520:	learn: 0.5668482	total: 30.3s	remaining: 27.9s
521:	learn: 0.5667726	total: 30.4s	remaining: 27.8s
522:	learn: 0.5666628	total: 30.5s	remaining: 27.8s
523:	learn: 0.5665701	total: 30.6s	remaining: 27.8s
524:	learn: 0.5665263	total: 30.6s	remaining: 27.7s
525:	learn: 0.5664459	total: 30.7s	remaining: 27.6s
526:	learn: 0.5663706	total: 30.7s	remaining: 27.5s
527:	learn: 0.5663004	total: 30.7s	remaining: 27.5s
528:	learn: 0.5662440	total: 30.8s	remaining: 27.4s
529:	learn: 0.5661691	total: 30.8s	remaining: 27.3s
530:	learn: 0.5660751	total: 30.9s	remaining: 27.3s
531:	learn: 0.5660274	total: 30.9s	remaining: 27.2s
532:	learn: 0.5659701	total: 31s	remaining: 27.1s
533:	learn: 0.5658907	total: 31s	remaining: 27.1s
534:	learn: 0.5658496	total: 31.1s	remaining: 27s
535:	learn: 0.5657727	total: 31.1s	remaining: 26.9s
536:	learn: 0.5657148	total: 31.2s	remaining: 26.9s
537:	learn: 0.5656798	total: 31.3s	remaining: 26.9s
538:	learn: 0.5655870	total: 31.3s	remaining: 26.8s
539:	learn: 0.5655169	total: 31.4s	remaining: 26.8s
540:	learn: 0.5654778	total: 31.5s	remaining: 26.7s
541:	learn: 0.5654410	total: 31.5s	remaining: 26.6s
542:	learn: 0.5653947	total: 31.6s	remaining: 26.6s
543:	learn: 0.5653192	total: 31.6s	remaining: 26.5s
544:	learn: 0.5652632	total: 31.7s	remaining: 26.4s
545:	learn: 0.5652041	total: 31.7s	remaining: 26.4s
546:	learn: 0.5651643	total: 31.8s	remaining: 26.3s
547:	learn: 0.5651099	total: 31.9s	remaining: 26.3s
548:	learn: 0.5650506	total: 31.9s	remaining: 26.2s
549:	learn: 0.5649904	total: 32s	remaining: 26.2s
550:	learn: 0.5649616	total: 32s	remaining: 26.1s
551:	learn: 0.5649221	total: 32.1s	remaining: 26s
552:	learn: 0.5648456	total: 32.2s	remaining: 26s
553:	learn: 0.5647705	total: 32.2s	remaining: 25.9s
554:	learn: 0.5647069	total: 32.2s	remaining: 25.9s
555:	learn: 0.5646027	total: 32.3s	remaining: 25.8s
556:	learn: 0.5645656	total: 32.3s	remaining: 25.7s
557:	learn: 0.5645410	total: 32.3s	remaining: 25.6s
558:	learn: 0.5644887	total: 32.4s	remaining: 25.5s
559:	learn: 0.5644195	total: 32.4s	remaining: 25.4s
560:	learn: 0.5643505	total: 32.4s	remaining: 25.4s
561:	learn: 0.5643040	total: 32.5s	remaining: 25.3s
562:	learn: 0.5642485	total: 32.5s	remaining: 25.2s
563:	learn: 0.5642051	total: 32.5s	remaining: 25.1s
564:	learn: 0.5641832	total: 32.5s	remaining: 25s
565:	learn: 0.5641138	total: 32.6s	remaining: 25s
566:	learn: 0.5640691	total: 32.6s	remaining: 24.9s
567:	learn: 0.5639882	total: 32.6s	remaining: 24.8s
568:	learn: 0.5639139	total: 32.7s	remaining: 24.7s
569:	learn: 0.5638478	total: 32.7s	remaining: 24.7s
570:	learn: 0.5637983	total: 32.7s	remaining: 24.6s
571:	learn: 0.5637435	total: 32.7s	remaining: 24.5s
572:	learn: 0.5636532	total: 32.8s	remaining: 24.4s
573:	learn: 0.5635914	total: 32.8s	remaining: 24.3s
574:	learn: 0.5635363	total: 32.8s	remaining: 24.3s
575:	learn: 0.5634697	total: 32.9s	remaining: 24.2s
576:	learn: 0.5633781	total: 32.9s	remaining: 24.1s
577:	learn: 0.5632960	total: 32.9s	remaining: 24.1s
578:	learn: 0.5632183	total: 33s	remaining: 24s
579:	learn: 0.5631797	total: 33s	remaining: 23.9s
580:	learn: 0.5631155	total: 33s	remaining: 23.8s
581:	learn: 0.5630495	total: 33.1s	remaining: 23.7s
582:	learn: 0.5629819	total: 33.1s	remaining: 23.7s
583:	learn: 0.5629187	total: 33.1s	remaining: 23.6s
584:	learn: 0.5628602	total: 33.1s	remaining: 23.5s
585:	learn: 0.5627490	total: 33.2s	remaining: 23.4s
586:	learn: 0.5627080	total: 33.2s	remaining: 23.4s
587:	learn: 0.5626347	total: 33.2s	remaining: 23.3s
588:	learn: 0.5625542	total: 33.3s	remaining: 23.2s
589:	learn: 0.5625109	total: 33.3s	remaining: 23.1s
590:	learn: 0.5624205	total: 33.3s	remaining: 23.1s
591:	learn: 0.5623577	total: 33.4s	remaining: 23s
592:	learn: 0.5623258	total: 33.4s	remaining: 22.9s
593:	learn: 0.5622322	total: 33.4s	remaining: 22.8s
594:	learn: 0.5621951	total: 33.4s	remaining: 22.8s
595:	learn: 0.5621678	total: 33.5s	remaining: 22.7s
596:	learn: 0.5620964	total: 33.5s	remaining: 22.6s
597:	learn: 0.5620682	total: 33.5s	remaining: 22.5s
598:	learn: 0.5620332	total: 33.5s	remaining: 22.5s
599:	learn: 0.5619786	total: 33.6s	remaining: 22.4s
600:	learn: 0.5618993	total: 33.6s	remaining: 22.3s
601:	learn: 0.5618329	total: 33.6s	remaining: 22.2s
602:	learn: 0.5617753	total: 33.7s	remaining: 22.2s
603:	learn: 0.5617007	total: 33.7s	remaining: 22.1s
604:	learn: 0.5616361	total: 33.7s	remaining: 22s
605:	learn: 0.5615500	total: 33.8s	remaining: 21.9s
606:	learn: 0.5614913	total: 33.8s	remaining: 21.9s
607:	learn: 0.5614444	total: 33.8s	remaining: 21.8s
608:	learn: 0.5614077	total: 33.8s	remaining: 21.7s
609:	learn: 0.5613358	total: 33.9s	remaining: 21.7s
610:	learn: 0.5613020	total: 33.9s	remaining: 21.6s
611:	learn: 0.5612156	total: 34s	remaining: 21.5s
612:	learn: 0.5611529	total: 34s	remaining: 21.5s
613:	learn: 0.5611189	total: 34s	remaining: 21.4s
614:	learn: 0.5610570	total: 34s	remaining: 21.3s
615:	learn: 0.5609792	total: 34.1s	remaining: 21.2s
616:	learn: 0.5609334	total: 34.1s	remaining: 21.2s
617:	learn: 0.5608789	total: 34.1s	remaining: 21.1s
618:	learn: 0.5608354	total: 34.2s	remaining: 21s
619:	learn: 0.5607762	total: 34.2s	remaining: 21s
620:	learn: 0.5607427	total: 34.2s	remaining: 20.9s
621:	learn: 0.5606781	total: 34.3s	remaining: 20.8s
622:	learn: 0.5606143	total: 34.3s	remaining: 20.7s
623:	learn: 0.5605488	total: 34.3s	remaining: 20.7s
624:	learn: 0.5605205	total: 34.3s	remaining: 20.6s
625:	learn: 0.5604514	total: 34.4s	remaining: 20.5s
626:	learn: 0.5603808	total: 34.4s	remaining: 20.5s
627:	learn: 0.5603381	total: 34.4s	remaining: 20.4s
628:	learn: 0.5603120	total: 34.5s	remaining: 20.3s
629:	learn: 0.5602604	total: 34.5s	remaining: 20.3s
630:	learn: 0.5602140	total: 34.5s	remaining: 20.2s
631:	learn: 0.5601611	total: 34.6s	remaining: 20.1s
632:	learn: 0.5600990	total: 34.6s	remaining: 20.1s
633:	learn: 0.5600750	total: 34.6s	remaining: 20s
634:	learn: 0.5600210	total: 34.6s	remaining: 19.9s
635:	learn: 0.5599699	total: 34.7s	remaining: 19.8s
636:	learn: 0.5598983	total: 34.7s	remaining: 19.8s
637:	learn: 0.5598380	total: 34.7s	remaining: 19.7s
638:	learn: 0.5597889	total: 34.8s	remaining: 19.6s
639:	learn: 0.5597589	total: 34.8s	remaining: 19.6s
640:	learn: 0.5596940	total: 34.8s	remaining: 19.5s
641:	learn: 0.5596580	total: 34.8s	remaining: 19.4s
642:	learn: 0.5596158	total: 34.9s	remaining: 19.4s
643:	learn: 0.5595722	total: 34.9s	remaining: 19.3s
644:	learn: 0.5594969	total: 34.9s	remaining: 19.2s
645:	learn: 0.5594421	total: 35s	remaining: 19.2s
646:	learn: 0.5593961	total: 35s	remaining: 19.1s
647:	learn: 0.5593671	total: 35s	remaining: 19s
648:	learn: 0.5593433	total: 35.1s	remaining: 19s
649:	learn: 0.5592727	total: 35.1s	remaining: 18.9s
650:	learn: 0.5592442	total: 35.1s	remaining: 18.8s
651:	learn: 0.5592064	total: 35.1s	remaining: 18.8s
652:	learn: 0.5591288	total: 35.2s	remaining: 18.7s
653:	learn: 0.5590701	total: 35.2s	remaining: 18.6s
654:	learn: 0.5590085	total: 35.2s	remaining: 18.6s
655:	learn: 0.5589110	total: 35.3s	remaining: 18.5s
656:	learn: 0.5588593	total: 35.3s	remaining: 18.4s
657:	learn: 0.5588286	total: 35.3s	remaining: 18.4s
658:	learn: 0.5587828	total: 35.4s	remaining: 18.3s
659:	learn: 0.5586930	total: 35.4s	remaining: 18.2s
660:	learn: 0.5586442	total: 35.4s	remaining: 18.2s
661:	learn: 0.5585922	total: 35.5s	remaining: 18.1s
662:	learn: 0.5585108	total: 35.5s	remaining: 18s
663:	learn: 0.5584557	total: 35.5s	remaining: 18s
664:	learn: 0.5583517	total: 35.6s	remaining: 17.9s
665:	learn: 0.5582975	total: 35.6s	remaining: 17.8s
666:	learn: 0.5582473	total: 35.6s	remaining: 17.8s
667:	learn: 0.5581790	total: 35.7s	remaining: 17.7s
668:	learn: 0.5581284	total: 35.7s	remaining: 17.7s
669:	learn: 0.5580739	total: 35.7s	remaining: 17.6s
670:	learn: 0.5580250	total: 35.7s	remaining: 17.5s
671:	learn: 0.5579431	total: 35.8s	remaining: 17.5s
672:	learn: 0.5578997	total: 35.8s	remaining: 17.4s
673:	learn: 0.5578211	total: 35.8s	remaining: 17.3s
674:	learn: 0.5577620	total: 35.9s	remaining: 17.3s
675:	learn: 0.5576755	total: 35.9s	remaining: 17.2s
676:	learn: 0.5575914	total: 35.9s	remaining: 17.1s
677:	learn: 0.5575218	total: 36s	remaining: 17.1s
678:	learn: 0.5574820	total: 36s	remaining: 17s
679:	learn: 0.5574604	total: 36s	remaining: 17s
680:	learn: 0.5574250	total: 36.1s	remaining: 16.9s
681:	learn: 0.5573583	total: 36.1s	remaining: 16.8s
682:	learn: 0.5572897	total: 36.1s	remaining: 16.8s
683:	learn: 0.5572455	total: 36.2s	remaining: 16.7s
684:	learn: 0.5571907	total: 36.2s	remaining: 16.6s
685:	learn: 0.5571400	total: 36.2s	remaining: 16.6s
686:	learn: 0.5571151	total: 36.2s	remaining: 16.5s
687:	learn: 0.5570598	total: 36.3s	remaining: 16.4s
688:	learn: 0.5569955	total: 36.3s	remaining: 16.4s
689:	learn: 0.5569425	total: 36.3s	remaining: 16.3s
690:	learn: 0.5569023	total: 36.4s	remaining: 16.3s
691:	learn: 0.5568356	total: 36.4s	remaining: 16.2s
692:	learn: 0.5568151	total: 36.4s	remaining: 16.1s
693:	learn: 0.5567903	total: 36.5s	remaining: 16.1s
694:	learn: 0.5567380	total: 36.5s	remaining: 16s
695:	learn: 0.5566950	total: 36.5s	remaining: 15.9s
696:	learn: 0.5566320	total: 36.5s	remaining: 15.9s
697:	learn: 0.5565823	total: 36.6s	remaining: 15.8s
698:	learn: 0.5565127	total: 36.6s	remaining: 15.8s
699:	learn: 0.5564636	total: 36.6s	remaining: 15.7s
700:	learn: 0.5564314	total: 36.7s	remaining: 15.6s
701:	learn: 0.5563825	total: 36.7s	remaining: 15.6s
702:	learn: 0.5563425	total: 36.7s	remaining: 15.5s
703:	learn: 0.5562897	total: 36.8s	remaining: 15.5s
704:	learn: 0.5562499	total: 36.8s	remaining: 15.4s
705:	learn: 0.5562129	total: 36.8s	remaining: 15.3s
706:	learn: 0.5561441	total: 36.8s	remaining: 15.3s
707:	learn: 0.5561025	total: 36.9s	remaining: 15.2s
708:	learn: 0.5560600	total: 36.9s	remaining: 15.1s
709:	learn: 0.5560136	total: 36.9s	remaining: 15.1s
710:	learn: 0.5559599	total: 37s	remaining: 15s
711:	learn: 0.5559389	total: 37s	remaining: 15s
712:	learn: 0.5558723	total: 37s	remaining: 14.9s
713:	learn: 0.5557741	total: 37.1s	remaining: 14.8s
714:	learn: 0.5557077	total: 37.1s	remaining: 14.8s
715:	learn: 0.5556673	total: 37.1s	remaining: 14.7s
716:	learn: 0.5555916	total: 37.1s	remaining: 14.7s
717:	learn: 0.5555237	total: 37.2s	remaining: 14.6s
718:	learn: 0.5554489	total: 37.2s	remaining: 14.5s
719:	learn: 0.5553882	total: 37.2s	remaining: 14.5s
720:	learn: 0.5553311	total: 37.3s	remaining: 14.4s
721:	learn: 0.5552769	total: 37.3s	remaining: 14.4s
722:	learn: 0.5552410	total: 37.3s	remaining: 14.3s
723:	learn: 0.5552023	total: 37.4s	remaining: 14.2s
724:	learn: 0.5551515	total: 37.4s	remaining: 14.2s
725:	learn: 0.5551046	total: 37.4s	remaining: 14.1s
726:	learn: 0.5550718	total: 37.4s	remaining: 14.1s
727:	learn: 0.5550311	total: 37.5s	remaining: 14s
728:	learn: 0.5549669	total: 37.5s	remaining: 13.9s
729:	learn: 0.5548914	total: 37.5s	remaining: 13.9s
730:	learn: 0.5548445	total: 37.6s	remaining: 13.8s
731:	learn: 0.5548039	total: 37.6s	remaining: 13.8s
732:	learn: 0.5547383	total: 37.6s	remaining: 13.7s
733:	learn: 0.5546675	total: 37.7s	remaining: 13.6s
734:	learn: 0.5545838	total: 37.7s	remaining: 13.6s
735:	learn: 0.5545362	total: 37.7s	remaining: 13.5s
736:	learn: 0.5544806	total: 37.8s	remaining: 13.5s
737:	learn: 0.5544357	total: 37.8s	remaining: 13.4s
738:	learn: 0.5543793	total: 37.8s	remaining: 13.4s
739:	learn: 0.5543450	total: 37.8s	remaining: 13.3s
740:	learn: 0.5542915	total: 37.9s	remaining: 13.2s
741:	learn: 0.5542572	total: 37.9s	remaining: 13.2s
742:	learn: 0.5542229	total: 37.9s	remaining: 13.1s
743:	learn: 0.5541790	total: 38s	remaining: 13.1s
744:	learn: 0.5541509	total: 38s	remaining: 13s
745:	learn: 0.5541161	total: 38s	remaining: 12.9s
746:	learn: 0.5540793	total: 38s	remaining: 12.9s
747:	learn: 0.5540530	total: 38.1s	remaining: 12.8s
748:	learn: 0.5539970	total: 38.1s	remaining: 12.8s
749:	learn: 0.5539099	total: 38.1s	remaining: 12.7s
750:	learn: 0.5538807	total: 38.2s	remaining: 12.7s
751:	learn: 0.5538187	total: 38.2s	remaining: 12.6s
752:	learn: 0.5537801	total: 38.2s	remaining: 12.5s
753:	learn: 0.5537256	total: 38.3s	remaining: 12.5s
754:	learn: 0.5536928	total: 38.3s	remaining: 12.4s
755:	learn: 0.5536526	total: 38.3s	remaining: 12.4s
756:	learn: 0.5536327	total: 38.3s	remaining: 12.3s
757:	learn: 0.5535495	total: 38.4s	remaining: 12.3s
758:	learn: 0.5535200	total: 38.4s	remaining: 12.2s
759:	learn: 0.5534579	total: 38.4s	remaining: 12.1s
760:	learn: 0.5534306	total: 38.5s	remaining: 12.1s
761:	learn: 0.5533564	total: 38.5s	remaining: 12s
762:	learn: 0.5533179	total: 38.5s	remaining: 12s
763:	learn: 0.5532712	total: 38.6s	remaining: 11.9s
764:	learn: 0.5532119	total: 38.6s	remaining: 11.9s
765:	learn: 0.5531784	total: 38.6s	remaining: 11.8s
766:	learn: 0.5531112	total: 38.7s	remaining: 11.7s
767:	learn: 0.5530576	total: 38.7s	remaining: 11.7s
768:	learn: 0.5530118	total: 38.8s	remaining: 11.6s
769:	learn: 0.5529753	total: 38.8s	remaining: 11.6s
770:	learn: 0.5529416	total: 38.8s	remaining: 11.5s
771:	learn: 0.5528772	total: 38.8s	remaining: 11.5s
772:	learn: 0.5528160	total: 38.9s	remaining: 11.4s
773:	learn: 0.5527949	total: 38.9s	remaining: 11.4s
774:	learn: 0.5527753	total: 38.9s	remaining: 11.3s
775:	learn: 0.5527464	total: 39s	remaining: 11.2s
776:	learn: 0.5526881	total: 39s	remaining: 11.2s
777:	learn: 0.5526383	total: 39s	remaining: 11.1s
778:	learn: 0.5526038	total: 39.1s	remaining: 11.1s
779:	learn: 0.5525444	total: 39.1s	remaining: 11s
780:	learn: 0.5525000	total: 39.1s	remaining: 11s
781:	learn: 0.5524341	total: 39.2s	remaining: 10.9s
782:	learn: 0.5523807	total: 39.2s	remaining: 10.9s
783:	learn: 0.5523295	total: 39.2s	remaining: 10.8s
784:	learn: 0.5522859	total: 39.2s	remaining: 10.7s
785:	learn: 0.5522572	total: 39.3s	remaining: 10.7s
786:	learn: 0.5522088	total: 39.3s	remaining: 10.6s
787:	learn: 0.5521071	total: 39.3s	remaining: 10.6s
788:	learn: 0.5520722	total: 39.4s	remaining: 10.5s
789:	learn: 0.5520202	total: 39.4s	remaining: 10.5s
790:	learn: 0.5519818	total: 39.4s	remaining: 10.4s
791:	learn: 0.5519472	total: 39.5s	remaining: 10.4s
792:	learn: 0.5518990	total: 39.5s	remaining: 10.3s
793:	learn: 0.5518164	total: 39.5s	remaining: 10.3s
794:	learn: 0.5517369	total: 39.6s	remaining: 10.2s
795:	learn: 0.5516606	total: 39.6s	remaining: 10.1s
796:	learn: 0.5516155	total: 39.6s	remaining: 10.1s
797:	learn: 0.5515528	total: 39.6s	remaining: 10s
798:	learn: 0.5515109	total: 39.7s	remaining: 9.98s
799:	learn: 0.5514212	total: 39.7s	remaining: 9.93s
800:	learn: 0.5513366	total: 39.7s	remaining: 9.87s
801:	learn: 0.5513122	total: 39.8s	remaining: 9.81s
802:	learn: 0.5512477	total: 39.8s	remaining: 9.76s
803:	learn: 0.5511894	total: 39.8s	remaining: 9.71s
804:	learn: 0.5511204	total: 39.8s	remaining: 9.65s
805:	learn: 0.5510466	total: 39.9s	remaining: 9.6s
806:	learn: 0.5510192	total: 39.9s	remaining: 9.54s
807:	learn: 0.5509527	total: 39.9s	remaining: 9.49s
808:	learn: 0.5509275	total: 40s	remaining: 9.44s
809:	learn: 0.5508755	total: 40s	remaining: 9.38s
810:	learn: 0.5508194	total: 40s	remaining: 9.33s
811:	learn: 0.5507509	total: 40.1s	remaining: 9.27s
812:	learn: 0.5506914	total: 40.1s	remaining: 9.22s
813:	learn: 0.5506472	total: 40.1s	remaining: 9.17s
814:	learn: 0.5505961	total: 40.2s	remaining: 9.12s
815:	learn: 0.5505308	total: 40.2s	remaining: 9.06s
816:	learn: 0.5505042	total: 40.2s	remaining: 9.01s
817:	learn: 0.5504319	total: 40.2s	remaining: 8.96s
818:	learn: 0.5503760	total: 40.3s	remaining: 8.9s
819:	learn: 0.5503149	total: 40.3s	remaining: 8.85s
820:	learn: 0.5502956	total: 40.3s	remaining: 8.79s
821:	learn: 0.5502594	total: 40.4s	remaining: 8.74s
822:	learn: 0.5502038	total: 40.4s	remaining: 8.69s
823:	learn: 0.5501312	total: 40.4s	remaining: 8.64s
824:	learn: 0.5501095	total: 40.5s	remaining: 8.58s
825:	learn: 0.5500692	total: 40.5s	remaining: 8.53s
826:	learn: 0.5500218	total: 40.5s	remaining: 8.48s
827:	learn: 0.5499690	total: 40.6s	remaining: 8.42s
828:	learn: 0.5499407	total: 40.6s	remaining: 8.37s
829:	learn: 0.5499058	total: 40.6s	remaining: 8.32s
830:	learn: 0.5498782	total: 40.6s	remaining: 8.26s
831:	learn: 0.5498299	total: 40.7s	remaining: 8.21s
832:	learn: 0.5497953	total: 40.7s	remaining: 8.16s
833:	learn: 0.5497218	total: 40.7s	remaining: 8.11s
834:	learn: 0.5496521	total: 40.8s	remaining: 8.05s
835:	learn: 0.5495751	total: 40.8s	remaining: 8s
836:	learn: 0.5495246	total: 40.8s	remaining: 7.95s
837:	learn: 0.5494567	total: 40.8s	remaining: 7.89s
838:	learn: 0.5494239	total: 40.9s	remaining: 7.84s
839:	learn: 0.5493984	total: 40.9s	remaining: 7.79s
840:	learn: 0.5493467	total: 40.9s	remaining: 7.74s
841:	learn: 0.5493156	total: 41s	remaining: 7.69s
842:	learn: 0.5492829	total: 41s	remaining: 7.63s
843:	learn: 0.5492456	total: 41s	remaining: 7.58s
844:	learn: 0.5491916	total: 41.1s	remaining: 7.53s
845:	learn: 0.5491490	total: 41.1s	remaining: 7.48s
846:	learn: 0.5490962	total: 41.1s	remaining: 7.43s
847:	learn: 0.5490231	total: 41.2s	remaining: 7.38s
848:	learn: 0.5489759	total: 41.2s	remaining: 7.32s
849:	learn: 0.5489349	total: 41.2s	remaining: 7.27s
850:	learn: 0.5488837	total: 41.2s	remaining: 7.22s
851:	learn: 0.5488241	total: 41.3s	remaining: 7.17s
852:	learn: 0.5487685	total: 41.3s	remaining: 7.12s
853:	learn: 0.5487129	total: 41.3s	remaining: 7.06s
854:	learn: 0.5486467	total: 41.4s	remaining: 7.01s
855:	learn: 0.5485815	total: 41.4s	remaining: 6.96s
856:	learn: 0.5485613	total: 41.4s	remaining: 6.91s
857:	learn: 0.5485001	total: 41.4s	remaining: 6.86s
858:	learn: 0.5484750	total: 41.5s	remaining: 6.81s
859:	learn: 0.5484193	total: 41.5s	remaining: 6.76s
860:	learn: 0.5483150	total: 41.5s	remaining: 6.71s
861:	learn: 0.5482582	total: 41.6s	remaining: 6.65s
862:	learn: 0.5482300	total: 41.6s	remaining: 6.6s
863:	learn: 0.5481533	total: 41.6s	remaining: 6.55s
864:	learn: 0.5481001	total: 41.7s	remaining: 6.5s
865:	learn: 0.5480492	total: 41.7s	remaining: 6.45s
866:	learn: 0.5480263	total: 41.7s	remaining: 6.4s
867:	learn: 0.5479744	total: 41.7s	remaining: 6.35s
868:	learn: 0.5479052	total: 41.8s	remaining: 6.3s
869:	learn: 0.5478497	total: 41.8s	remaining: 6.25s
870:	learn: 0.5478010	total: 41.8s	remaining: 6.2s
871:	learn: 0.5477544	total: 41.9s	remaining: 6.15s
872:	learn: 0.5477007	total: 41.9s	remaining: 6.09s
873:	learn: 0.5476559	total: 41.9s	remaining: 6.04s
874:	learn: 0.5476184	total: 42s	remaining: 6s
875:	learn: 0.5475540	total: 42s	remaining: 5.95s
876:	learn: 0.5474934	total: 42s	remaining: 5.89s
877:	learn: 0.5474461	total: 42.1s	remaining: 5.84s
878:	learn: 0.5473807	total: 42.1s	remaining: 5.79s
879:	learn: 0.5473283	total: 42.1s	remaining: 5.74s
880:	learn: 0.5472936	total: 42.2s	remaining: 5.69s
881:	learn: 0.5472513	total: 42.2s	remaining: 5.64s
882:	learn: 0.5471975	total: 42.2s	remaining: 5.59s
883:	learn: 0.5471603	total: 42.2s	remaining: 5.54s
884:	learn: 0.5471277	total: 42.3s	remaining: 5.49s
885:	learn: 0.5470797	total: 42.3s	remaining: 5.44s
886:	learn: 0.5470265	total: 42.3s	remaining: 5.39s
887:	learn: 0.5469909	total: 42.4s	remaining: 5.34s
888:	learn: 0.5469581	total: 42.4s	remaining: 5.29s
889:	learn: 0.5469181	total: 42.4s	remaining: 5.25s
890:	learn: 0.5468537	total: 42.5s	remaining: 5.2s
891:	learn: 0.5468268	total: 42.5s	remaining: 5.14s
892:	learn: 0.5467706	total: 42.5s	remaining: 5.09s
893:	learn: 0.5467280	total: 42.6s	remaining: 5.04s
894:	learn: 0.5466997	total: 42.6s	remaining: 5s
895:	learn: 0.5466566	total: 42.6s	remaining: 4.95s
896:	learn: 0.5465864	total: 42.6s	remaining: 4.9s
897:	learn: 0.5465337	total: 42.7s	remaining: 4.85s
898:	learn: 0.5464585	total: 42.7s	remaining: 4.8s
899:	learn: 0.5464043	total: 42.7s	remaining: 4.75s
900:	learn: 0.5463319	total: 42.8s	remaining: 4.7s
901:	learn: 0.5462805	total: 42.8s	remaining: 4.65s
902:	learn: 0.5462339	total: 42.8s	remaining: 4.6s
903:	learn: 0.5461869	total: 42.9s	remaining: 4.55s
904:	learn: 0.5461515	total: 42.9s	remaining: 4.5s
905:	learn: 0.5461271	total: 42.9s	remaining: 4.45s
906:	learn: 0.5460860	total: 42.9s	remaining: 4.4s
907:	learn: 0.5460408	total: 43s	remaining: 4.35s
908:	learn: 0.5459823	total: 43s	remaining: 4.3s
909:	learn: 0.5459465	total: 43s	remaining: 4.26s
910:	learn: 0.5458987	total: 43.1s	remaining: 4.21s
911:	learn: 0.5458426	total: 43.1s	remaining: 4.16s
912:	learn: 0.5457832	total: 43.1s	remaining: 4.11s
913:	learn: 0.5457019	total: 43.2s	remaining: 4.06s
914:	learn: 0.5456598	total: 43.2s	remaining: 4.01s
915:	learn: 0.5455985	total: 43.2s	remaining: 3.96s
916:	learn: 0.5455344	total: 43.3s	remaining: 3.91s
917:	learn: 0.5454842	total: 43.3s	remaining: 3.87s
918:	learn: 0.5454503	total: 43.3s	remaining: 3.82s
919:	learn: 0.5453786	total: 43.3s	remaining: 3.77s
920:	learn: 0.5453365	total: 43.4s	remaining: 3.72s
921:	learn: 0.5452543	total: 43.4s	remaining: 3.67s
922:	learn: 0.5452017	total: 43.4s	remaining: 3.62s
923:	learn: 0.5451649	total: 43.5s	remaining: 3.57s
924:	learn: 0.5451410	total: 43.5s	remaining: 3.52s
925:	learn: 0.5450846	total: 43.5s	remaining: 3.48s
926:	learn: 0.5450451	total: 43.5s	remaining: 3.43s
927:	learn: 0.5449952	total: 43.6s	remaining: 3.38s
928:	learn: 0.5449357	total: 43.6s	remaining: 3.33s
929:	learn: 0.5448731	total: 43.6s	remaining: 3.28s
930:	learn: 0.5448441	total: 43.7s	remaining: 3.23s
931:	learn: 0.5448152	total: 43.7s	remaining: 3.19s
932:	learn: 0.5447754	total: 43.7s	remaining: 3.14s
933:	learn: 0.5447360	total: 43.7s	remaining: 3.09s
934:	learn: 0.5446807	total: 43.8s	remaining: 3.04s
935:	learn: 0.5446472	total: 43.8s	remaining: 2.99s
936:	learn: 0.5445809	total: 43.8s	remaining: 2.95s
937:	learn: 0.5445074	total: 43.9s	remaining: 2.9s
938:	learn: 0.5444636	total: 43.9s	remaining: 2.85s
939:	learn: 0.5444222	total: 43.9s	remaining: 2.8s
940:	learn: 0.5443668	total: 44s	remaining: 2.76s
941:	learn: 0.5443216	total: 44s	remaining: 2.71s
942:	learn: 0.5442101	total: 44s	remaining: 2.66s
943:	learn: 0.5441730	total: 44.1s	remaining: 2.61s
944:	learn: 0.5441489	total: 44.1s	remaining: 2.56s
945:	learn: 0.5440945	total: 44.1s	remaining: 2.52s
946:	learn: 0.5440385	total: 44.2s	remaining: 2.47s
947:	learn: 0.5440011	total: 44.2s	remaining: 2.42s
948:	learn: 0.5439525	total: 44.2s	remaining: 2.38s
949:	learn: 0.5438900	total: 44.2s	remaining: 2.33s
950:	learn: 0.5438443	total: 44.3s	remaining: 2.28s
951:	learn: 0.5438062	total: 44.3s	remaining: 2.23s
952:	learn: 0.5437764	total: 44.3s	remaining: 2.19s
953:	learn: 0.5437142	total: 44.4s	remaining: 2.14s
954:	learn: 0.5436798	total: 44.4s	remaining: 2.09s
955:	learn: 0.5436385	total: 44.4s	remaining: 2.04s
956:	learn: 0.5435932	total: 44.4s	remaining: 2s
957:	learn: 0.5435779	total: 44.5s	remaining: 1.95s
958:	learn: 0.5435570	total: 44.5s	remaining: 1.9s
959:	learn: 0.5435376	total: 44.5s	remaining: 1.85s
960:	learn: 0.5434562	total: 44.6s	remaining: 1.81s
961:	learn: 0.5434058	total: 44.6s	remaining: 1.76s
962:	learn: 0.5433765	total: 44.6s	remaining: 1.71s
963:	learn: 0.5433339	total: 44.6s	remaining: 1.67s
964:	learn: 0.5433136	total: 44.7s	remaining: 1.62s
965:	learn: 0.5432549	total: 44.7s	remaining: 1.57s
966:	learn: 0.5431974	total: 44.7s	remaining: 1.53s
967:	learn: 0.5431383	total: 44.8s	remaining: 1.48s
968:	learn: 0.5430998	total: 44.8s	remaining: 1.43s
969:	learn: 0.5430393	total: 44.8s	remaining: 1.39s
970:	learn: 0.5430073	total: 44.9s	remaining: 1.34s
971:	learn: 0.5429809	total: 44.9s	remaining: 1.29s
972:	learn: 0.5429355	total: 44.9s	remaining: 1.25s
973:	learn: 0.5428477	total: 45s	remaining: 1.2s
974:	learn: 0.5427893	total: 45s	remaining: 1.15s
975:	learn: 0.5427631	total: 45s	remaining: 1.11s
976:	learn: 0.5427174	total: 45.1s	remaining: 1.06s
977:	learn: 0.5426499	total: 45.1s	remaining: 1.01s
978:	learn: 0.5426010	total: 45.1s	remaining: 968ms
979:	learn: 0.5425616	total: 45.2s	remaining: 921ms
980:	learn: 0.5424990	total: 45.2s	remaining: 875ms
981:	learn: 0.5424560	total: 45.2s	remaining: 829ms
982:	learn: 0.5423908	total: 45.2s	remaining: 783ms
983:	learn: 0.5423493	total: 45.3s	remaining: 736ms
984:	learn: 0.5423188	total: 45.3s	remaining: 690ms
985:	learn: 0.5422601	total: 45.3s	remaining: 644ms
986:	learn: 0.5422232	total: 45.4s	remaining: 598ms
987:	learn: 0.5421996	total: 45.4s	remaining: 551ms
988:	learn: 0.5421382	total: 45.4s	remaining: 505ms
989:	learn: 0.5420771	total: 45.5s	remaining: 459ms
990:	learn: 0.5420496	total: 45.5s	remaining: 413ms
991:	learn: 0.5420189	total: 45.5s	remaining: 367ms
992:	learn: 0.5419889	total: 45.5s	remaining: 321ms
993:	learn: 0.5419475	total: 45.6s	remaining: 275ms
994:	learn: 0.5419055	total: 45.6s	remaining: 229ms
995:	learn: 0.5418701	total: 45.6s	remaining: 183ms
996:	learn: 0.5418288	total: 45.7s	remaining: 137ms
997:	learn: 0.5417645	total: 45.7s	remaining: 91.6ms
998:	learn: 0.5417294	total: 45.7s	remaining: 45.8ms
999:	learn: 0.5416788	total: 45.8s	remaining: 0us
0.8296709552544689

Feature Engineering

In this section, we do some feature engineering to choose the best features for our prediction model. We also experimented with many more statistical features, but they were not relevant in the end. We added that to the Appendix.

We start by adding datetime features

In [ ]:
def add_datetime_features(df):
    df['year']    = df['timestamp_measured'].dt.year
    df['month']   = df['timestamp_measured'].dt.month
    df['day']     = df['timestamp_measured'].dt.day
    df['week']    = (df['timestamp_measured'].dt.isocalendar().week).astype("int")
    df['weekday'] = df['timestamp_measured'].dt.weekday
    df['weekend'] = (df['timestamp_measured'].dt.weekday >= 5).astype("int")
    df['hour']    = df['timestamp_measured'].dt.hour
    df['afternoon'] = (df['hour'] >= 12).astype("int")

add_datetime_features(train_df)
add_datetime_features(test_df)

Next, we add the most important features in timeseries datasets, lags. We add 7 hour lags and 7 days lags.

In [ ]:
# Time lags
targets = ['NO2', 'PM10', 'PM25']
for t in targets:
  for delta in range(1,8):
      day = train_df.copy()
      day['timestamp_measured'] = day['timestamp_measured'] + pd.Timedelta(delta, unit="d")
      name = f'{t}_lag_{delta}'
      day = day.rename(columns={t:name})[['timestamp_measured', name]]
      train_df = train_df.merge(day, on=['timestamp_measured'], how='left')

for t in targets:
  for delta in range(1,8):
      day = train_df.copy()
      day['timestamp_measured'] = day['timestamp_measured'] + pd.Timedelta(delta, unit="h")
      name = f'{t}_lag_hour_{delta}'
      day = day.rename(columns={t:name})[['timestamp_measured', name]]
      train_df = train_df.merge(day, on=['timestamp_measured'], how='left')

targets = ['NO2', 'PM10', 'PM25']
for t in targets:
  for delta in range(1,8):
      day = test_df.copy()
      day['timestamp_measured'] = day['timestamp_measured'] + pd.Timedelta(delta, unit="d")
      name = f'{t}_lag_{delta}'
      day = day.rename(columns={t:name})[['timestamp_measured', name]]
      test_df = test_df.merge(day, on=['timestamp_measured'], how='left')

for t in targets:
  for delta in range(1,8):
      day = test_df.copy()
      day['timestamp_measured'] = day['timestamp_measured'] + pd.Timedelta(delta, unit="h")
      name = f'{t}_lag_hour_{delta}'
      day = day.rename(columns={t:name})[['timestamp_measured', name]]
      test_df = test_df.merge(day, on=['timestamp_measured'], how='left')
In [ ]:
targets = ['NO2', 'PM10', 'PM25', 'PM25_CAQI', 'PM10_CAQI', 'NO2_CAQI', 'CAQI']

X_train = train_df.copy()
X_train = X_train.drop(['timestamp_measured'], axis=1)
Y_train = X_train['CAQI']
X_train = X_train.drop(targets, axis=1)

X_test = test_df.copy()
X_test = X_test.drop(['timestamp_measured'], axis=1)
Y_test = X_test['CAQI']
X_test = X_test.drop(targets, axis=1)

Next, we will look at the mutual information of these features to check that they are good features.

In [ ]:
from sklearn.feature_selection import mutual_info_regression
import seaborn as sns

# Mutual Information does not support Nans, we filled them with 0
Xmi_train = X_train.fillna(0)

mi_scores = mutual_info_regression(Xmi_train[:52173], Y_train)
mi_scores = pd.Series(mi_scores, name="MI_score", index=Xmi_train.columns)
mi_scores = mi_scores.sort_values(ascending=False)
df_mi_scores = pd.DataFrame(mi_scores).reset_index().rename(columns={'component_id':'feature'})

sns.barplot(y=df_mi_scores['feature'].loc[:20], x=df_mi_scores['MI_score'].loc[:20])
Out[ ]:
<matplotlib.axes._subplots.AxesSubplot at 0x7f81a6845190>

Modelling

Now we model with the features we choosed in the last section

In [ ]:
clf = xgb.XGBClassifier()
clf.fit(X_train, Y_train)
xgb.plot_importance(clf)

preds = clf.predict(X_test)
print(accuracy_score(Y_test, preds))
0.9033359899806445
In [ ]:
train_pool = Pool(X_train, Y_train)
test_pool = Pool(X_test) 

model = CatBoostClassifier()
model.fit(train_pool)

preds = model.predict(test_pool)
print(accuracy_score(Y_test, preds))
Learning rate set to 0.096808
0:	learn: 1.3676983	total: 155ms	remaining: 2m 34s
1:	learn: 1.2082717	total: 326ms	remaining: 2m 42s
2:	learn: 1.0877912	total: 444ms	remaining: 2m 27s
3:	learn: 0.9917484	total: 576ms	remaining: 2m 23s
4:	learn: 0.9165672	total: 696ms	remaining: 2m 18s
5:	learn: 0.8511882	total: 833ms	remaining: 2m 17s
6:	learn: 0.7970076	total: 961ms	remaining: 2m 16s
7:	learn: 0.7497168	total: 1.08s	remaining: 2m 14s
8:	learn: 0.7087130	total: 1.2s	remaining: 2m 11s
9:	learn: 0.6725658	total: 1.31s	remaining: 2m 10s
10:	learn: 0.6429319	total: 1.47s	remaining: 2m 12s
11:	learn: 0.6163200	total: 1.59s	remaining: 2m 10s
12:	learn: 0.5940150	total: 1.71s	remaining: 2m 9s
13:	learn: 0.5730689	total: 1.83s	remaining: 2m 8s
14:	learn: 0.5544940	total: 1.94s	remaining: 2m 7s
15:	learn: 0.5382294	total: 2.07s	remaining: 2m 7s
16:	learn: 0.5225740	total: 2.2s	remaining: 2m 7s
17:	learn: 0.5089489	total: 2.32s	remaining: 2m 6s
18:	learn: 0.4966084	total: 2.44s	remaining: 2m 5s
19:	learn: 0.4861833	total: 2.56s	remaining: 2m 5s
20:	learn: 0.4763935	total: 2.68s	remaining: 2m 5s
21:	learn: 0.4678453	total: 2.8s	remaining: 2m 4s
22:	learn: 0.4599571	total: 2.94s	remaining: 2m 4s
23:	learn: 0.4529649	total: 3.05s	remaining: 2m 4s
24:	learn: 0.4461928	total: 3.18s	remaining: 2m 3s
25:	learn: 0.4403632	total: 3.31s	remaining: 2m 3s
26:	learn: 0.4355453	total: 3.44s	remaining: 2m 4s
27:	learn: 0.4305959	total: 3.56s	remaining: 2m 3s
28:	learn: 0.4260675	total: 3.68s	remaining: 2m 3s
29:	learn: 0.4224188	total: 3.8s	remaining: 2m 2s
30:	learn: 0.4187137	total: 3.92s	remaining: 2m 2s
31:	learn: 0.4150616	total: 4.06s	remaining: 2m 2s
32:	learn: 0.4119839	total: 4.19s	remaining: 2m 2s
33:	learn: 0.4090739	total: 4.3s	remaining: 2m 2s
34:	learn: 0.4064531	total: 4.43s	remaining: 2m 2s
35:	learn: 0.4037546	total: 4.53s	remaining: 2m 1s
36:	learn: 0.4014112	total: 4.65s	remaining: 2m
37:	learn: 0.3990986	total: 4.76s	remaining: 2m
38:	learn: 0.3971949	total: 4.88s	remaining: 2m
39:	learn: 0.3953422	total: 5s	remaining: 2m
40:	learn: 0.3938983	total: 5.12s	remaining: 1m 59s
41:	learn: 0.3924052	total: 5.28s	remaining: 2m
42:	learn: 0.3909354	total: 5.39s	remaining: 1m 59s
43:	learn: 0.3891877	total: 5.5s	remaining: 1m 59s
44:	learn: 0.3881224	total: 5.62s	remaining: 1m 59s
45:	learn: 0.3871148	total: 5.73s	remaining: 1m 58s
46:	learn: 0.3858763	total: 5.85s	remaining: 1m 58s
47:	learn: 0.3850421	total: 5.97s	remaining: 1m 58s
48:	learn: 0.3842726	total: 6.1s	remaining: 1m 58s
49:	learn: 0.3832387	total: 6.22s	remaining: 1m 58s
50:	learn: 0.3824571	total: 6.32s	remaining: 1m 57s
51:	learn: 0.3815007	total: 6.46s	remaining: 1m 57s
52:	learn: 0.3807875	total: 6.57s	remaining: 1m 57s
53:	learn: 0.3797544	total: 6.68s	remaining: 1m 57s
54:	learn: 0.3790844	total: 6.81s	remaining: 1m 57s
55:	learn: 0.3784936	total: 6.91s	remaining: 1m 56s
56:	learn: 0.3776429	total: 7.04s	remaining: 1m 56s
57:	learn: 0.3769930	total: 7.15s	remaining: 1m 56s
58:	learn: 0.3763481	total: 7.25s	remaining: 1m 55s
59:	learn: 0.3757605	total: 7.39s	remaining: 1m 55s
60:	learn: 0.3752572	total: 7.5s	remaining: 1m 55s
61:	learn: 0.3745588	total: 7.62s	remaining: 1m 55s
62:	learn: 0.3741588	total: 7.76s	remaining: 1m 55s
63:	learn: 0.3738724	total: 7.87s	remaining: 1m 55s
64:	learn: 0.3734369	total: 8s	remaining: 1m 55s
65:	learn: 0.3730450	total: 8.11s	remaining: 1m 54s
66:	learn: 0.3726954	total: 8.21s	remaining: 1m 54s
67:	learn: 0.3722624	total: 8.32s	remaining: 1m 54s
68:	learn: 0.3715598	total: 8.44s	remaining: 1m 53s
69:	learn: 0.3710771	total: 8.56s	remaining: 1m 53s
70:	learn: 0.3705923	total: 8.68s	remaining: 1m 53s
71:	learn: 0.3703013	total: 8.8s	remaining: 1m 53s
72:	learn: 0.3696947	total: 8.92s	remaining: 1m 53s
73:	learn: 0.3693358	total: 9.04s	remaining: 1m 53s
74:	learn: 0.3690147	total: 9.14s	remaining: 1m 52s
75:	learn: 0.3685955	total: 9.28s	remaining: 1m 52s
76:	learn: 0.3678907	total: 9.42s	remaining: 1m 52s
77:	learn: 0.3674289	total: 9.54s	remaining: 1m 52s
78:	learn: 0.3670268	total: 9.66s	remaining: 1m 52s
79:	learn: 0.3666224	total: 9.79s	remaining: 1m 52s
80:	learn: 0.3661070	total: 9.94s	remaining: 1m 52s
81:	learn: 0.3657279	total: 10.1s	remaining: 1m 52s
82:	learn: 0.3654720	total: 10.2s	remaining: 1m 52s
83:	learn: 0.3649032	total: 10.3s	remaining: 1m 52s
84:	learn: 0.3646695	total: 10.4s	remaining: 1m 52s
85:	learn: 0.3644556	total: 10.6s	remaining: 1m 52s
86:	learn: 0.3641507	total: 10.7s	remaining: 1m 51s
87:	learn: 0.3635305	total: 10.8s	remaining: 1m 51s
88:	learn: 0.3631954	total: 10.9s	remaining: 1m 51s
89:	learn: 0.3625758	total: 11s	remaining: 1m 51s
90:	learn: 0.3622095	total: 11.2s	remaining: 1m 51s
91:	learn: 0.3618657	total: 11.3s	remaining: 1m 51s
92:	learn: 0.3616322	total: 11.4s	remaining: 1m 51s
93:	learn: 0.3613143	total: 11.5s	remaining: 1m 50s
94:	learn: 0.3608799	total: 11.7s	remaining: 1m 51s
95:	learn: 0.3605082	total: 11.8s	remaining: 1m 51s
96:	learn: 0.3600283	total: 11.9s	remaining: 1m 51s
97:	learn: 0.3595338	total: 12.1s	remaining: 1m 51s
98:	learn: 0.3592559	total: 12.2s	remaining: 1m 50s
99:	learn: 0.3588864	total: 12.3s	remaining: 1m 50s
100:	learn: 0.3586033	total: 12.4s	remaining: 1m 50s
101:	learn: 0.3583601	total: 12.5s	remaining: 1m 50s
102:	learn: 0.3580683	total: 12.6s	remaining: 1m 49s
103:	learn: 0.3577228	total: 12.7s	remaining: 1m 49s
104:	learn: 0.3574421	total: 12.8s	remaining: 1m 49s
105:	learn: 0.3572364	total: 12.9s	remaining: 1m 49s
106:	learn: 0.3568592	total: 13.1s	remaining: 1m 49s
107:	learn: 0.3565546	total: 13.2s	remaining: 1m 49s
108:	learn: 0.3564165	total: 13.3s	remaining: 1m 48s
109:	learn: 0.3562603	total: 13.4s	remaining: 1m 48s
110:	learn: 0.3559606	total: 13.5s	remaining: 1m 48s
111:	learn: 0.3556220	total: 13.7s	remaining: 1m 48s
112:	learn: 0.3551960	total: 13.8s	remaining: 1m 48s
113:	learn: 0.3548503	total: 13.9s	remaining: 1m 48s
114:	learn: 0.3546747	total: 14s	remaining: 1m 48s
115:	learn: 0.3544843	total: 14.2s	remaining: 1m 47s
116:	learn: 0.3541774	total: 14.3s	remaining: 1m 47s
117:	learn: 0.3538495	total: 14.4s	remaining: 1m 47s
118:	learn: 0.3535996	total: 14.5s	remaining: 1m 47s
119:	learn: 0.3533728	total: 14.6s	remaining: 1m 47s
120:	learn: 0.3531281	total: 14.7s	remaining: 1m 47s
121:	learn: 0.3529513	total: 14.9s	remaining: 1m 46s
122:	learn: 0.3527377	total: 15s	remaining: 1m 46s
123:	learn: 0.3525682	total: 15.1s	remaining: 1m 46s
124:	learn: 0.3522783	total: 15.2s	remaining: 1m 46s
125:	learn: 0.3521038	total: 15.3s	remaining: 1m 46s
126:	learn: 0.3518691	total: 15.4s	remaining: 1m 45s
127:	learn: 0.3515852	total: 15.5s	remaining: 1m 45s
128:	learn: 0.3514066	total: 15.6s	remaining: 1m 45s
129:	learn: 0.3512216	total: 15.7s	remaining: 1m 45s
130:	learn: 0.3509248	total: 15.8s	remaining: 1m 44s
131:	learn: 0.3505425	total: 15.9s	remaining: 1m 44s
132:	learn: 0.3501968	total: 16.1s	remaining: 1m 44s
133:	learn: 0.3499590	total: 16.2s	remaining: 1m 44s
134:	learn: 0.3496489	total: 16.3s	remaining: 1m 44s
135:	learn: 0.3494699	total: 16.4s	remaining: 1m 44s
136:	learn: 0.3492522	total: 16.5s	remaining: 1m 44s
137:	learn: 0.3488817	total: 16.7s	remaining: 1m 44s
138:	learn: 0.3487310	total: 16.8s	remaining: 1m 44s
139:	learn: 0.3483733	total: 16.9s	remaining: 1m 43s
140:	learn: 0.3481281	total: 17s	remaining: 1m 43s
141:	learn: 0.3479113	total: 17.1s	remaining: 1m 43s
142:	learn: 0.3476952	total: 17.2s	remaining: 1m 43s
143:	learn: 0.3474852	total: 17.4s	remaining: 1m 43s
144:	learn: 0.3472163	total: 17.5s	remaining: 1m 43s
145:	learn: 0.3468988	total: 17.6s	remaining: 1m 43s
146:	learn: 0.3465315	total: 17.7s	remaining: 1m 42s
147:	learn: 0.3462228	total: 17.8s	remaining: 1m 42s
148:	learn: 0.3459151	total: 18s	remaining: 1m 42s
149:	learn: 0.3457465	total: 18.1s	remaining: 1m 42s
150:	learn: 0.3455158	total: 18.2s	remaining: 1m 42s
151:	learn: 0.3453371	total: 18.3s	remaining: 1m 42s
152:	learn: 0.3451923	total: 18.4s	remaining: 1m 42s
153:	learn: 0.3449975	total: 18.6s	remaining: 1m 41s
154:	learn: 0.3447326	total: 18.7s	remaining: 1m 41s
155:	learn: 0.3444464	total: 18.8s	remaining: 1m 41s
156:	learn: 0.3442521	total: 18.9s	remaining: 1m 41s
157:	learn: 0.3441128	total: 19s	remaining: 1m 41s
158:	learn: 0.3439494	total: 19.1s	remaining: 1m 41s
159:	learn: 0.3438536	total: 19.2s	remaining: 1m 41s
160:	learn: 0.3435678	total: 19.4s	remaining: 1m 40s
161:	learn: 0.3434260	total: 19.5s	remaining: 1m 40s
162:	learn: 0.3432023	total: 19.6s	remaining: 1m 40s
163:	learn: 0.3430123	total: 19.7s	remaining: 1m 40s
164:	learn: 0.3427842	total: 19.8s	remaining: 1m 40s
165:	learn: 0.3425611	total: 19.9s	remaining: 1m 40s
166:	learn: 0.3423595	total: 20.1s	remaining: 1m 40s
167:	learn: 0.3421553	total: 20.2s	remaining: 1m 39s
168:	learn: 0.3419587	total: 20.3s	remaining: 1m 39s
169:	learn: 0.3418014	total: 20.4s	remaining: 1m 39s
170:	learn: 0.3416607	total: 20.5s	remaining: 1m 39s
171:	learn: 0.3415559	total: 20.7s	remaining: 1m 39s
172:	learn: 0.3414080	total: 20.8s	remaining: 1m 39s
173:	learn: 0.3412024	total: 20.9s	remaining: 1m 39s
174:	learn: 0.3410599	total: 21s	remaining: 1m 39s
175:	learn: 0.3408837	total: 21.1s	remaining: 1m 38s
176:	learn: 0.3407538	total: 21.3s	remaining: 1m 38s
177:	learn: 0.3404933	total: 21.4s	remaining: 1m 38s
178:	learn: 0.3402952	total: 21.5s	remaining: 1m 38s
179:	learn: 0.3400700	total: 21.6s	remaining: 1m 38s
180:	learn: 0.3399728	total: 21.7s	remaining: 1m 38s
181:	learn: 0.3397786	total: 21.8s	remaining: 1m 38s
182:	learn: 0.3396538	total: 21.9s	remaining: 1m 37s
183:	learn: 0.3394774	total: 22.1s	remaining: 1m 37s
184:	learn: 0.3392588	total: 22.2s	remaining: 1m 37s
185:	learn: 0.3390830	total: 22.3s	remaining: 1m 37s
186:	learn: 0.3389294	total: 22.4s	remaining: 1m 37s
187:	learn: 0.3387139	total: 22.6s	remaining: 1m 37s
188:	learn: 0.3385414	total: 22.7s	remaining: 1m 37s
189:	learn: 0.3382605	total: 22.8s	remaining: 1m 37s
190:	learn: 0.3380958	total: 22.9s	remaining: 1m 37s
191:	learn: 0.3377989	total: 23.1s	remaining: 1m 37s
192:	learn: 0.3376505	total: 23.2s	remaining: 1m 36s
193:	learn: 0.3374253	total: 23.3s	remaining: 1m 36s
194:	learn: 0.3372303	total: 23.4s	remaining: 1m 36s
195:	learn: 0.3369625	total: 23.6s	remaining: 1m 36s
196:	learn: 0.3368725	total: 23.7s	remaining: 1m 36s
197:	learn: 0.3366838	total: 23.8s	remaining: 1m 36s
198:	learn: 0.3365229	total: 23.9s	remaining: 1m 36s
199:	learn: 0.3363231	total: 24s	remaining: 1m 36s
200:	learn: 0.3361339	total: 24.2s	remaining: 1m 36s
201:	learn: 0.3360297	total: 24.3s	remaining: 1m 35s
202:	learn: 0.3358323	total: 24.4s	remaining: 1m 35s
203:	learn: 0.3356352	total: 24.5s	remaining: 1m 35s
204:	learn: 0.3353558	total: 24.6s	remaining: 1m 35s
205:	learn: 0.3351401	total: 24.7s	remaining: 1m 35s
206:	learn: 0.3349706	total: 24.9s	remaining: 1m 35s
207:	learn: 0.3348136	total: 25s	remaining: 1m 35s
208:	learn: 0.3346409	total: 25.1s	remaining: 1m 34s
209:	learn: 0.3345065	total: 25.2s	remaining: 1m 34s
210:	learn: 0.3344101	total: 25.3s	remaining: 1m 34s
211:	learn: 0.3341292	total: 25.4s	remaining: 1m 34s
212:	learn: 0.3339593	total: 25.5s	remaining: 1m 34s
213:	learn: 0.3337597	total: 25.6s	remaining: 1m 34s
214:	learn: 0.3336607	total: 25.7s	remaining: 1m 33s
215:	learn: 0.3334457	total: 25.9s	remaining: 1m 33s
216:	learn: 0.3332860	total: 26s	remaining: 1m 33s
217:	learn: 0.3330640	total: 26.1s	remaining: 1m 33s
218:	learn: 0.3328351	total: 26.2s	remaining: 1m 33s
219:	learn: 0.3325745	total: 26.4s	remaining: 1m 33s
220:	learn: 0.3323481	total: 26.5s	remaining: 1m 33s
221:	learn: 0.3322164	total: 26.6s	remaining: 1m 33s
222:	learn: 0.3320722	total: 26.7s	remaining: 1m 33s
223:	learn: 0.3318334	total: 26.8s	remaining: 1m 32s
224:	learn: 0.3317026	total: 27s	remaining: 1m 32s
225:	learn: 0.3315169	total: 27.1s	remaining: 1m 32s
226:	learn: 0.3313276	total: 27.2s	remaining: 1m 32s
227:	learn: 0.3311734	total: 27.3s	remaining: 1m 32s
228:	learn: 0.3310005	total: 27.4s	remaining: 1m 32s
229:	learn: 0.3307760	total: 27.6s	remaining: 1m 32s
230:	learn: 0.3306711	total: 27.7s	remaining: 1m 32s
231:	learn: 0.3304258	total: 27.8s	remaining: 1m 32s
232:	learn: 0.3301737	total: 27.9s	remaining: 1m 31s
233:	learn: 0.3298676	total: 28.1s	remaining: 1m 31s
234:	learn: 0.3296130	total: 28.2s	remaining: 1m 31s
235:	learn: 0.3294425	total: 28.3s	remaining: 1m 31s
236:	learn: 0.3293624	total: 28.4s	remaining: 1m 31s
237:	learn: 0.3291488	total: 28.5s	remaining: 1m 31s
238:	learn: 0.3290204	total: 28.7s	remaining: 1m 31s
239:	learn: 0.3288863	total: 28.8s	remaining: 1m 31s
240:	learn: 0.3286343	total: 28.9s	remaining: 1m 30s
241:	learn: 0.3285375	total: 29s	remaining: 1m 30s
242:	learn: 0.3282777	total: 29.1s	remaining: 1m 30s
243:	learn: 0.3281070	total: 29.2s	remaining: 1m 30s
244:	learn: 0.3280045	total: 29.3s	remaining: 1m 30s
245:	learn: 0.3278438	total: 29.4s	remaining: 1m 30s
246:	learn: 0.3277189	total: 29.5s	remaining: 1m 29s
247:	learn: 0.3274982	total: 29.6s	remaining: 1m 29s
248:	learn: 0.3273197	total: 29.8s	remaining: 1m 29s
249:	learn: 0.3271632	total: 29.9s	remaining: 1m 29s
250:	learn: 0.3269804	total: 30s	remaining: 1m 29s
251:	learn: 0.3267565	total: 30.1s	remaining: 1m 29s
252:	learn: 0.3265887	total: 30.3s	remaining: 1m 29s
253:	learn: 0.3263988	total: 30.4s	remaining: 1m 29s
254:	learn: 0.3262733	total: 30.5s	remaining: 1m 29s
255:	learn: 0.3261707	total: 30.6s	remaining: 1m 28s
256:	learn: 0.3260927	total: 30.7s	remaining: 1m 28s
257:	learn: 0.3258654	total: 30.8s	remaining: 1m 28s
258:	learn: 0.3256814	total: 30.9s	remaining: 1m 28s
259:	learn: 0.3256061	total: 31s	remaining: 1m 28s
260:	learn: 0.3255502	total: 31.1s	remaining: 1m 28s
261:	learn: 0.3253980	total: 31.3s	remaining: 1m 28s
262:	learn: 0.3252152	total: 31.4s	remaining: 1m 27s
263:	learn: 0.3251099	total: 31.5s	remaining: 1m 27s
264:	learn: 0.3249007	total: 31.6s	remaining: 1m 27s
265:	learn: 0.3247478	total: 31.7s	remaining: 1m 27s
266:	learn: 0.3245914	total: 31.8s	remaining: 1m 27s
267:	learn: 0.3243603	total: 31.9s	remaining: 1m 27s
268:	learn: 0.3241712	total: 32.1s	remaining: 1m 27s
269:	learn: 0.3239588	total: 32.2s	remaining: 1m 27s
270:	learn: 0.3237904	total: 32.3s	remaining: 1m 26s
271:	learn: 0.3235903	total: 32.5s	remaining: 1m 26s
272:	learn: 0.3234492	total: 32.6s	remaining: 1m 26s
273:	learn: 0.3231561	total: 32.7s	remaining: 1m 26s
274:	learn: 0.3230363	total: 32.8s	remaining: 1m 26s
275:	learn: 0.3228591	total: 32.9s	remaining: 1m 26s
276:	learn: 0.3227872	total: 33s	remaining: 1m 26s
277:	learn: 0.3226239	total: 33.2s	remaining: 1m 26s
278:	learn: 0.3224817	total: 33.3s	remaining: 1m 26s
279:	learn: 0.3223374	total: 33.4s	remaining: 1m 25s
280:	learn: 0.3222021	total: 33.5s	remaining: 1m 25s
281:	learn: 0.3221008	total: 33.6s	remaining: 1m 25s
282:	learn: 0.3219644	total: 33.7s	remaining: 1m 25s
283:	learn: 0.3218204	total: 33.9s	remaining: 1m 25s
284:	learn: 0.3217119	total: 34s	remaining: 1m 25s
285:	learn: 0.3215614	total: 34.1s	remaining: 1m 25s
286:	learn: 0.3214165	total: 34.2s	remaining: 1m 25s
287:	learn: 0.3212274	total: 34.4s	remaining: 1m 24s
288:	learn: 0.3210836	total: 34.5s	remaining: 1m 24s
289:	learn: 0.3209590	total: 34.6s	remaining: 1m 24s
290:	learn: 0.3208015	total: 34.7s	remaining: 1m 24s
291:	learn: 0.3205979	total: 34.9s	remaining: 1m 24s
292:	learn: 0.3203925	total: 35s	remaining: 1m 24s
293:	learn: 0.3202606	total: 35.1s	remaining: 1m 24s
294:	learn: 0.3200425	total: 35.3s	remaining: 1m 24s
295:	learn: 0.3199229	total: 35.4s	remaining: 1m 24s
296:	learn: 0.3198527	total: 35.5s	remaining: 1m 23s
297:	learn: 0.3196880	total: 35.6s	remaining: 1m 23s
298:	learn: 0.3195375	total: 35.7s	remaining: 1m 23s
299:	learn: 0.3192787	total: 35.9s	remaining: 1m 23s
300:	learn: 0.3190454	total: 36s	remaining: 1m 23s
301:	learn: 0.3188693	total: 36.1s	remaining: 1m 23s
302:	learn: 0.3186882	total: 36.2s	remaining: 1m 23s
303:	learn: 0.3186073	total: 36.3s	remaining: 1m 23s
304:	learn: 0.3184783	total: 36.4s	remaining: 1m 22s
305:	learn: 0.3183532	total: 36.5s	remaining: 1m 22s
306:	learn: 0.3182034	total: 36.6s	remaining: 1m 22s
307:	learn: 0.3180745	total: 36.7s	remaining: 1m 22s
308:	learn: 0.3178824	total: 36.9s	remaining: 1m 22s
309:	learn: 0.3177808	total: 37s	remaining: 1m 22s
310:	learn: 0.3176234	total: 37.1s	remaining: 1m 22s
311:	learn: 0.3174427	total: 37.2s	remaining: 1m 22s
312:	learn: 0.3173802	total: 37.3s	remaining: 1m 21s
313:	learn: 0.3172545	total: 37.4s	remaining: 1m 21s
314:	learn: 0.3171156	total: 37.5s	remaining: 1m 21s
315:	learn: 0.3170132	total: 37.6s	remaining: 1m 21s
316:	learn: 0.3168185	total: 37.8s	remaining: 1m 21s
317:	learn: 0.3166456	total: 37.9s	remaining: 1m 21s
318:	learn: 0.3164692	total: 38s	remaining: 1m 21s
319:	learn: 0.3163031	total: 38.1s	remaining: 1m 21s
320:	learn: 0.3161393	total: 38.3s	remaining: 1m 20s
321:	learn: 0.3159895	total: 38.4s	remaining: 1m 20s
322:	learn: 0.3159229	total: 38.5s	remaining: 1m 20s
323:	learn: 0.3158475	total: 38.6s	remaining: 1m 20s
324:	learn: 0.3156924	total: 38.7s	remaining: 1m 20s
325:	learn: 0.3155440	total: 38.8s	remaining: 1m 20s
326:	learn: 0.3154032	total: 38.9s	remaining: 1m 20s
327:	learn: 0.3151744	total: 39.1s	remaining: 1m 20s
328:	learn: 0.3148962	total: 39.2s	remaining: 1m 19s
329:	learn: 0.3147833	total: 39.3s	remaining: 1m 19s
330:	learn: 0.3146653	total: 39.4s	remaining: 1m 19s
331:	learn: 0.3145480	total: 39.6s	remaining: 1m 19s
332:	learn: 0.3142919	total: 39.7s	remaining: 1m 19s
333:	learn: 0.3141642	total: 39.8s	remaining: 1m 19s
334:	learn: 0.3139573	total: 40s	remaining: 1m 19s
335:	learn: 0.3138557	total: 40.1s	remaining: 1m 19s
336:	learn: 0.3137271	total: 40.2s	remaining: 1m 19s
337:	learn: 0.3135450	total: 40.3s	remaining: 1m 18s
338:	learn: 0.3134028	total: 40.4s	remaining: 1m 18s
339:	learn: 0.3132434	total: 40.5s	remaining: 1m 18s
340:	learn: 0.3131689	total: 40.7s	remaining: 1m 18s
341:	learn: 0.3131167	total: 40.8s	remaining: 1m 18s
342:	learn: 0.3130105	total: 40.9s	remaining: 1m 18s
343:	learn: 0.3129101	total: 41s	remaining: 1m 18s
344:	learn: 0.3126948	total: 41.1s	remaining: 1m 18s
345:	learn: 0.3125972	total: 41.2s	remaining: 1m 17s
346:	learn: 0.3124324	total: 41.4s	remaining: 1m 17s
347:	learn: 0.3123171	total: 41.5s	remaining: 1m 17s
348:	learn: 0.3121668	total: 41.6s	remaining: 1m 17s
349:	learn: 0.3121000	total: 41.7s	remaining: 1m 17s
350:	learn: 0.3119947	total: 41.8s	remaining: 1m 17s
351:	learn: 0.3118663	total: 41.9s	remaining: 1m 17s
352:	learn: 0.3117328	total: 42s	remaining: 1m 16s
353:	learn: 0.3116400	total: 42.1s	remaining: 1m 16s
354:	learn: 0.3114516	total: 42.2s	remaining: 1m 16s
355:	learn: 0.3112966	total: 42.4s	remaining: 1m 16s
356:	learn: 0.3111950	total: 42.5s	remaining: 1m 16s
357:	learn: 0.3110309	total: 42.6s	remaining: 1m 16s
358:	learn: 0.3108724	total: 42.7s	remaining: 1m 16s
359:	learn: 0.3106533	total: 42.9s	remaining: 1m 16s
360:	learn: 0.3105451	total: 43s	remaining: 1m 16s
361:	learn: 0.3104131	total: 43.1s	remaining: 1m 15s
362:	learn: 0.3102965	total: 43.2s	remaining: 1m 15s
363:	learn: 0.3102113	total: 43.3s	remaining: 1m 15s
364:	learn: 0.3099933	total: 43.4s	remaining: 1m 15s
365:	learn: 0.3099127	total: 43.5s	remaining: 1m 15s
366:	learn: 0.3097381	total: 43.7s	remaining: 1m 15s
367:	learn: 0.3096248	total: 43.8s	remaining: 1m 15s
368:	learn: 0.3095173	total: 43.9s	remaining: 1m 15s
369:	learn: 0.3093302	total: 44s	remaining: 1m 14s
370:	learn: 0.3092106	total: 44.1s	remaining: 1m 14s
371:	learn: 0.3090754	total: 44.2s	remaining: 1m 14s
372:	learn: 0.3089631	total: 44.3s	remaining: 1m 14s
373:	learn: 0.3087999	total: 44.4s	remaining: 1m 14s
374:	learn: 0.3086748	total: 44.6s	remaining: 1m 14s
375:	learn: 0.3085683	total: 44.7s	remaining: 1m 14s
376:	learn: 0.3083551	total: 44.8s	remaining: 1m 14s
377:	learn: 0.3082589	total: 44.9s	remaining: 1m 13s
378:	learn: 0.3081621	total: 45s	remaining: 1m 13s
379:	learn: 0.3080540	total: 45.2s	remaining: 1m 13s
380:	learn: 0.3079378	total: 45.3s	remaining: 1m 13s
381:	learn: 0.3077835	total: 45.4s	remaining: 1m 13s
382:	learn: 0.3076470	total: 45.5s	remaining: 1m 13s
383:	learn: 0.3075248	total: 45.6s	remaining: 1m 13s
384:	learn: 0.3074227	total: 45.7s	remaining: 1m 13s
385:	learn: 0.3073165	total: 45.8s	remaining: 1m 12s
386:	learn: 0.3071961	total: 46s	remaining: 1m 12s
387:	learn: 0.3070304	total: 46.1s	remaining: 1m 12s
388:	learn: 0.3068878	total: 46.2s	remaining: 1m 12s
389:	learn: 0.3067898	total: 46.3s	remaining: 1m 12s
390:	learn: 0.3066213	total: 46.4s	remaining: 1m 12s
391:	learn: 0.3064986	total: 46.6s	remaining: 1m 12s
392:	learn: 0.3064274	total: 46.7s	remaining: 1m 12s
393:	learn: 0.3063410	total: 46.8s	remaining: 1m 11s
394:	learn: 0.3062480	total: 46.9s	remaining: 1m 11s
395:	learn: 0.3060790	total: 47s	remaining: 1m 11s
396:	learn: 0.3059509	total: 47.1s	remaining: 1m 11s
397:	learn: 0.3058883	total: 47.2s	remaining: 1m 11s
398:	learn: 0.3057837	total: 47.3s	remaining: 1m 11s
399:	learn: 0.3056895	total: 47.4s	remaining: 1m 11s
400:	learn: 0.3056152	total: 47.5s	remaining: 1m 11s
401:	learn: 0.3055202	total: 47.7s	remaining: 1m 10s
402:	learn: 0.3054034	total: 47.8s	remaining: 1m 10s
403:	learn: 0.3052282	total: 47.9s	remaining: 1m 10s
404:	learn: 0.3050943	total: 48s	remaining: 1m 10s
405:	learn: 0.3049389	total: 48.1s	remaining: 1m 10s
406:	learn: 0.3048101	total: 48.2s	remaining: 1m 10s
407:	learn: 0.3046336	total: 48.4s	remaining: 1m 10s
408:	learn: 0.3045187	total: 48.5s	remaining: 1m 10s
409:	learn: 0.3044044	total: 48.6s	remaining: 1m 9s
410:	learn: 0.3043176	total: 48.7s	remaining: 1m 9s
411:	learn: 0.3041734	total: 48.8s	remaining: 1m 9s
412:	learn: 0.3040979	total: 48.9s	remaining: 1m 9s
413:	learn: 0.3038881	total: 49.1s	remaining: 1m 9s
414:	learn: 0.3037905	total: 49.2s	remaining: 1m 9s
415:	learn: 0.3036909	total: 49.3s	remaining: 1m 9s
416:	learn: 0.3034235	total: 49.4s	remaining: 1m 9s
417:	learn: 0.3032129	total: 49.6s	remaining: 1m 9s
418:	learn: 0.3030646	total: 49.7s	remaining: 1m 8s
419:	learn: 0.3028801	total: 49.8s	remaining: 1m 8s
420:	learn: 0.3026927	total: 50s	remaining: 1m 8s
421:	learn: 0.3025544	total: 50.1s	remaining: 1m 8s
422:	learn: 0.3024112	total: 50.2s	remaining: 1m 8s
423:	learn: 0.3022590	total: 50.3s	remaining: 1m 8s
424:	learn: 0.3021766	total: 50.4s	remaining: 1m 8s
425:	learn: 0.3020694	total: 50.5s	remaining: 1m 8s
426:	learn: 0.3019567	total: 50.7s	remaining: 1m 7s
427:	learn: 0.3018563	total: 50.8s	remaining: 1m 7s
428:	learn: 0.3017014	total: 50.9s	remaining: 1m 7s
429:	learn: 0.3016204	total: 51s	remaining: 1m 7s
430:	learn: 0.3015685	total: 51.1s	remaining: 1m 7s
431:	learn: 0.3014133	total: 51.2s	remaining: 1m 7s
432:	learn: 0.3012952	total: 51.3s	remaining: 1m 7s
433:	learn: 0.3011556	total: 51.4s	remaining: 1m 7s
434:	learn: 0.3010477	total: 51.6s	remaining: 1m 6s
435:	learn: 0.3009584	total: 51.7s	remaining: 1m 6s
436:	learn: 0.3008251	total: 51.8s	remaining: 1m 6s
437:	learn: 0.3007457	total: 51.9s	remaining: 1m 6s
438:	learn: 0.3005879	total: 52.1s	remaining: 1m 6s
439:	learn: 0.3005107	total: 52.2s	remaining: 1m 6s
440:	learn: 0.3004117	total: 52.3s	remaining: 1m 6s
441:	learn: 0.3003004	total: 52.4s	remaining: 1m 6s
442:	learn: 0.3001527	total: 52.5s	remaining: 1m 6s
443:	learn: 0.3000933	total: 52.6s	remaining: 1m 5s
444:	learn: 0.2999625	total: 52.7s	remaining: 1m 5s
445:	learn: 0.2998900	total: 52.9s	remaining: 1m 5s
446:	learn: 0.2998230	total: 53s	remaining: 1m 5s
447:	learn: 0.2996584	total: 53.1s	remaining: 1m 5s
448:	learn: 0.2995905	total: 53.2s	remaining: 1m 5s
449:	learn: 0.2994603	total: 53.3s	remaining: 1m 5s
450:	learn: 0.2993144	total: 53.4s	remaining: 1m 5s
451:	learn: 0.2991815	total: 53.6s	remaining: 1m 4s
452:	learn: 0.2990741	total: 53.7s	remaining: 1m 4s
453:	learn: 0.2989661	total: 53.8s	remaining: 1m 4s
454:	learn: 0.2988671	total: 53.9s	remaining: 1m 4s
455:	learn: 0.2987226	total: 54.1s	remaining: 1m 4s
456:	learn: 0.2986127	total: 54.2s	remaining: 1m 4s
457:	learn: 0.2984845	total: 54.3s	remaining: 1m 4s
458:	learn: 0.2982902	total: 54.4s	remaining: 1m 4s
459:	learn: 0.2981728	total: 54.5s	remaining: 1m 4s
460:	learn: 0.2980217	total: 54.7s	remaining: 1m 3s
461:	learn: 0.2979123	total: 54.8s	remaining: 1m 3s
462:	learn: 0.2978053	total: 54.9s	remaining: 1m 3s
463:	learn: 0.2977577	total: 55s	remaining: 1m 3s
464:	learn: 0.2976747	total: 55.1s	remaining: 1m 3s
465:	learn: 0.2975435	total: 55.2s	remaining: 1m 3s
466:	learn: 0.2974303	total: 55.3s	remaining: 1m 3s
467:	learn: 0.2972749	total: 55.5s	remaining: 1m 3s
468:	learn: 0.2971588	total: 55.6s	remaining: 1m 2s
469:	learn: 0.2970464	total: 55.7s	remaining: 1m 2s
470:	learn: 0.2969975	total: 55.8s	remaining: 1m 2s
471:	learn: 0.2968639	total: 55.9s	remaining: 1m 2s
472:	learn: 0.2967723	total: 56s	remaining: 1m 2s
473:	learn: 0.2965993	total: 56.1s	remaining: 1m 2s
474:	learn: 0.2964816	total: 56.3s	remaining: 1m 2s
475:	learn: 0.2964047	total: 56.4s	remaining: 1m 2s
476:	learn: 0.2962753	total: 56.5s	remaining: 1m 1s
477:	learn: 0.2961717	total: 56.6s	remaining: 1m 1s
478:	learn: 0.2961059	total: 56.7s	remaining: 1m 1s
479:	learn: 0.2959001	total: 56.8s	remaining: 1m 1s
480:	learn: 0.2957393	total: 57s	remaining: 1m 1s
481:	learn: 0.2956468	total: 57.1s	remaining: 1m 1s
482:	learn: 0.2955082	total: 57.2s	remaining: 1m 1s
483:	learn: 0.2954352	total: 57.4s	remaining: 1m 1s
484:	learn: 0.2953331	total: 57.5s	remaining: 1m 1s
485:	learn: 0.2952261	total: 57.6s	remaining: 1m
486:	learn: 0.2950977	total: 57.7s	remaining: 1m
487:	learn: 0.2949241	total: 57.8s	remaining: 1m
488:	learn: 0.2948062	total: 58s	remaining: 1m
489:	learn: 0.2947068	total: 58.1s	remaining: 1m
490:	learn: 0.2945752	total: 58.2s	remaining: 1m
491:	learn: 0.2943961	total: 58.3s	remaining: 1m
492:	learn: 0.2943146	total: 58.4s	remaining: 1m
493:	learn: 0.2941636	total: 58.6s	remaining: 60s
494:	learn: 0.2940388	total: 58.7s	remaining: 59.9s
495:	learn: 0.2939517	total: 58.8s	remaining: 59.7s
496:	learn: 0.2938271	total: 58.9s	remaining: 59.6s
497:	learn: 0.2936522	total: 59s	remaining: 59.5s
498:	learn: 0.2935265	total: 59.1s	remaining: 59.4s
499:	learn: 0.2933943	total: 59.3s	remaining: 59.3s
500:	learn: 0.2932616	total: 59.4s	remaining: 59.1s
501:	learn: 0.2931373	total: 59.5s	remaining: 59s
502:	learn: 0.2930273	total: 59.6s	remaining: 58.9s
503:	learn: 0.2929144	total: 59.7s	remaining: 58.8s
504:	learn: 0.2928079	total: 59.9s	remaining: 58.7s
505:	learn: 0.2926868	total: 60s	remaining: 58.5s
506:	learn: 0.2925975	total: 1m	remaining: 58.4s
507:	learn: 0.2924733	total: 1m	remaining: 58.3s
508:	learn: 0.2923606	total: 1m	remaining: 58.2s
509:	learn: 0.2922770	total: 1m	remaining: 58.1s
510:	learn: 0.2921015	total: 1m	remaining: 58s
511:	learn: 0.2919660	total: 1m	remaining: 57.8s
512:	learn: 0.2918459	total: 1m	remaining: 57.7s
513:	learn: 0.2917286	total: 1m	remaining: 57.6s
514:	learn: 0.2915917	total: 1m 1s	remaining: 57.5s
515:	learn: 0.2915084	total: 1m 1s	remaining: 57.4s
516:	learn: 0.2913781	total: 1m 1s	remaining: 57.3s
517:	learn: 0.2912727	total: 1m 1s	remaining: 57.1s
518:	learn: 0.2911261	total: 1m 1s	remaining: 57s
519:	learn: 0.2909469	total: 1m 1s	remaining: 56.9s
520:	learn: 0.2908566	total: 1m 1s	remaining: 56.8s
521:	learn: 0.2907750	total: 1m 1s	remaining: 56.7s
522:	learn: 0.2906490	total: 1m 2s	remaining: 56.6s
523:	learn: 0.2905437	total: 1m 2s	remaining: 56.5s
524:	learn: 0.2903869	total: 1m 2s	remaining: 56.4s
525:	learn: 0.2902290	total: 1m 2s	remaining: 56.2s
526:	learn: 0.2901272	total: 1m 2s	remaining: 56.1s
527:	learn: 0.2900534	total: 1m 2s	remaining: 56s
528:	learn: 0.2899420	total: 1m 2s	remaining: 55.9s
529:	learn: 0.2897789	total: 1m 2s	remaining: 55.8s
530:	learn: 0.2897272	total: 1m 3s	remaining: 55.6s
531:	learn: 0.2896153	total: 1m 3s	remaining: 55.5s
532:	learn: 0.2895060	total: 1m 3s	remaining: 55.4s
533:	learn: 0.2893183	total: 1m 3s	remaining: 55.3s
534:	learn: 0.2892069	total: 1m 3s	remaining: 55.2s
535:	learn: 0.2890673	total: 1m 3s	remaining: 55.1s
536:	learn: 0.2889669	total: 1m 3s	remaining: 54.9s
537:	learn: 0.2888891	total: 1m 3s	remaining: 54.8s
538:	learn: 0.2887451	total: 1m 3s	remaining: 54.7s
539:	learn: 0.2886178	total: 1m 4s	remaining: 54.6s
540:	learn: 0.2885151	total: 1m 4s	remaining: 54.4s
541:	learn: 0.2883814	total: 1m 4s	remaining: 54.3s
542:	learn: 0.2882550	total: 1m 4s	remaining: 54.2s
543:	learn: 0.2881065	total: 1m 4s	remaining: 54.1s
544:	learn: 0.2879827	total: 1m 4s	remaining: 54s
545:	learn: 0.2878388	total: 1m 4s	remaining: 53.9s
546:	learn: 0.2877238	total: 1m 4s	remaining: 53.8s
547:	learn: 0.2876662	total: 1m 5s	remaining: 53.6s
548:	learn: 0.2875006	total: 1m 5s	remaining: 53.5s
549:	learn: 0.2873944	total: 1m 5s	remaining: 53.4s
550:	learn: 0.2873284	total: 1m 5s	remaining: 53.3s
551:	learn: 0.2872312	total: 1m 5s	remaining: 53.3s
552:	learn: 0.2871390	total: 1m 5s	remaining: 53.3s
553:	learn: 0.2870445	total: 1m 6s	remaining: 53.5s
554:	learn: 0.2869930	total: 1m 6s	remaining: 53.5s
555:	learn: 0.2868341	total: 1m 6s	remaining: 53.4s
556:	learn: 0.2866661	total: 1m 6s	remaining: 53.3s
557:	learn: 0.2865748	total: 1m 7s	remaining: 53.2s
558:	learn: 0.2864447	total: 1m 7s	remaining: 53s
559:	learn: 0.2862873	total: 1m 7s	remaining: 52.9s
560:	learn: 0.2861754	total: 1m 7s	remaining: 52.8s
561:	learn: 0.2860206	total: 1m 7s	remaining: 52.7s
562:	learn: 0.2858852	total: 1m 7s	remaining: 52.6s
563:	learn: 0.2857883	total: 1m 7s	remaining: 52.4s
564:	learn: 0.2856430	total: 1m 7s	remaining: 52.3s
565:	learn: 0.2855493	total: 1m 8s	remaining: 52.2s
566:	learn: 0.2854204	total: 1m 8s	remaining: 52.1s
567:	learn: 0.2853308	total: 1m 8s	remaining: 52s
568:	learn: 0.2852481	total: 1m 8s	remaining: 51.8s
569:	learn: 0.2851337	total: 1m 8s	remaining: 51.7s
570:	learn: 0.2850127	total: 1m 8s	remaining: 51.6s
571:	learn: 0.2848202	total: 1m 8s	remaining: 51.5s
572:	learn: 0.2846929	total: 1m 8s	remaining: 51.4s
573:	learn: 0.2846066	total: 1m 9s	remaining: 51.3s
574:	learn: 0.2845067	total: 1m 9s	remaining: 51.1s
575:	learn: 0.2843687	total: 1m 9s	remaining: 51s
576:	learn: 0.2842026	total: 1m 9s	remaining: 50.9s
577:	learn: 0.2841282	total: 1m 9s	remaining: 50.8s
578:	learn: 0.2840495	total: 1m 9s	remaining: 50.6s
579:	learn: 0.2839573	total: 1m 9s	remaining: 50.5s
580:	learn: 0.2838636	total: 1m 9s	remaining: 50.4s
581:	learn: 0.2837008	total: 1m 10s	remaining: 50.3s
582:	learn: 0.2836022	total: 1m 10s	remaining: 50.2s
583:	learn: 0.2834720	total: 1m 10s	remaining: 50.1s
584:	learn: 0.2833959	total: 1m 10s	remaining: 49.9s
585:	learn: 0.2833169	total: 1m 10s	remaining: 49.8s
586:	learn: 0.2832426	total: 1m 10s	remaining: 49.7s
587:	learn: 0.2831194	total: 1m 10s	remaining: 49.5s
588:	learn: 0.2829744	total: 1m 10s	remaining: 49.4s
589:	learn: 0.2828727	total: 1m 10s	remaining: 49.3s
590:	learn: 0.2827085	total: 1m 11s	remaining: 49.2s
591:	learn: 0.2826411	total: 1m 11s	remaining: 49s
592:	learn: 0.2824804	total: 1m 11s	remaining: 48.9s
593:	learn: 0.2823555	total: 1m 11s	remaining: 48.8s
594:	learn: 0.2822512	total: 1m 11s	remaining: 48.7s
595:	learn: 0.2821792	total: 1m 11s	remaining: 48.6s
596:	learn: 0.2821004	total: 1m 11s	remaining: 48.4s
597:	learn: 0.2819957	total: 1m 11s	remaining: 48.3s
598:	learn: 0.2819044	total: 1m 11s	remaining: 48.2s
599:	learn: 0.2818045	total: 1m 12s	remaining: 48.1s
600:	learn: 0.2816407	total: 1m 12s	remaining: 47.9s
601:	learn: 0.2815527	total: 1m 12s	remaining: 47.8s
602:	learn: 0.2814213	total: 1m 12s	remaining: 47.7s
603:	learn: 0.2812981	total: 1m 12s	remaining: 47.6s
604:	learn: 0.2811885	total: 1m 12s	remaining: 47.5s
605:	learn: 0.2811078	total: 1m 12s	remaining: 47.4s
606:	learn: 0.2810286	total: 1m 12s	remaining: 47.2s
607:	learn: 0.2809250	total: 1m 13s	remaining: 47.1s
608:	learn: 0.2808229	total: 1m 13s	remaining: 47s
609:	learn: 0.2807205	total: 1m 13s	remaining: 46.9s
610:	learn: 0.2806320	total: 1m 13s	remaining: 46.7s
611:	learn: 0.2805067	total: 1m 13s	remaining: 46.6s
612:	learn: 0.2804159	total: 1m 13s	remaining: 46.5s
613:	learn: 0.2803483	total: 1m 13s	remaining: 46.4s
614:	learn: 0.2802471	total: 1m 13s	remaining: 46.3s
615:	learn: 0.2801502	total: 1m 14s	remaining: 46.1s
616:	learn: 0.2800173	total: 1m 14s	remaining: 46s
617:	learn: 0.2799079	total: 1m 14s	remaining: 45.9s
618:	learn: 0.2798176	total: 1m 14s	remaining: 45.8s
619:	learn: 0.2797394	total: 1m 14s	remaining: 45.7s
620:	learn: 0.2796031	total: 1m 14s	remaining: 45.5s
621:	learn: 0.2795095	total: 1m 14s	remaining: 45.4s
622:	learn: 0.2793714	total: 1m 14s	remaining: 45.3s
623:	learn: 0.2792144	total: 1m 14s	remaining: 45.2s
624:	learn: 0.2790694	total: 1m 15s	remaining: 45.1s
625:	learn: 0.2789777	total: 1m 15s	remaining: 44.9s
626:	learn: 0.2788274	total: 1m 15s	remaining: 44.8s
627:	learn: 0.2786949	total: 1m 15s	remaining: 44.7s
628:	learn: 0.2786061	total: 1m 15s	remaining: 44.6s
629:	learn: 0.2785090	total: 1m 15s	remaining: 44.5s
630:	learn: 0.2784503	total: 1m 15s	remaining: 44.4s
631:	learn: 0.2784077	total: 1m 15s	remaining: 44.2s
632:	learn: 0.2782990	total: 1m 16s	remaining: 44.1s
633:	learn: 0.2782285	total: 1m 16s	remaining: 44s
634:	learn: 0.2780416	total: 1m 16s	remaining: 43.9s
635:	learn: 0.2779541	total: 1m 16s	remaining: 43.7s
636:	learn: 0.2778517	total: 1m 16s	remaining: 43.6s
637:	learn: 0.2777460	total: 1m 16s	remaining: 43.5s
638:	learn: 0.2776269	total: 1m 16s	remaining: 43.4s
639:	learn: 0.2775386	total: 1m 16s	remaining: 43.3s
640:	learn: 0.2774179	total: 1m 17s	remaining: 43.1s
641:	learn: 0.2773375	total: 1m 17s	remaining: 43s
642:	learn: 0.2772264	total: 1m 17s	remaining: 42.9s
643:	learn: 0.2771328	total: 1m 17s	remaining: 42.8s
644:	learn: 0.2770507	total: 1m 17s	remaining: 42.6s
645:	learn: 0.2769100	total: 1m 17s	remaining: 42.5s
646:	learn: 0.2768190	total: 1m 17s	remaining: 42.4s
647:	learn: 0.2767319	total: 1m 17s	remaining: 42.3s
648:	learn: 0.2766217	total: 1m 17s	remaining: 42.1s
649:	learn: 0.2765065	total: 1m 18s	remaining: 42s
650:	learn: 0.2764346	total: 1m 18s	remaining: 41.9s
651:	learn: 0.2763889	total: 1m 18s	remaining: 41.8s
652:	learn: 0.2762464	total: 1m 18s	remaining: 41.7s
653:	learn: 0.2761565	total: 1m 18s	remaining: 41.6s
654:	learn: 0.2760222	total: 1m 18s	remaining: 41.4s
655:	learn: 0.2759380	total: 1m 18s	remaining: 41.3s
656:	learn: 0.2757890	total: 1m 18s	remaining: 41.2s
657:	learn: 0.2756361	total: 1m 19s	remaining: 41.1s
658:	learn: 0.2755491	total: 1m 19s	remaining: 40.9s
659:	learn: 0.2754691	total: 1m 19s	remaining: 40.8s
660:	learn: 0.2753427	total: 1m 19s	remaining: 40.7s
661:	learn: 0.2752450	total: 1m 19s	remaining: 40.6s
662:	learn: 0.2751826	total: 1m 19s	remaining: 40.5s
663:	learn: 0.2750589	total: 1m 19s	remaining: 40.3s
664:	learn: 0.2749403	total: 1m 19s	remaining: 40.2s
665:	learn: 0.2748509	total: 1m 19s	remaining: 40.1s
666:	learn: 0.2747276	total: 1m 20s	remaining: 40s
667:	learn: 0.2745949	total: 1m 20s	remaining: 39.8s
668:	learn: 0.2744407	total: 1m 20s	remaining: 39.7s
669:	learn: 0.2743187	total: 1m 20s	remaining: 39.6s
670:	learn: 0.2741940	total: 1m 20s	remaining: 39.5s
671:	learn: 0.2740949	total: 1m 20s	remaining: 39.4s
672:	learn: 0.2739690	total: 1m 20s	remaining: 39.3s
673:	learn: 0.2738978	total: 1m 20s	remaining: 39.1s
674:	learn: 0.2738084	total: 1m 20s	remaining: 39s
675:	learn: 0.2737014	total: 1m 21s	remaining: 38.9s
676:	learn: 0.2735399	total: 1m 21s	remaining: 38.7s
677:	learn: 0.2734418	total: 1m 21s	remaining: 38.6s
678:	learn: 0.2733283	total: 1m 21s	remaining: 38.5s
679:	learn: 0.2732142	total: 1m 21s	remaining: 38.4s
680:	learn: 0.2730792	total: 1m 21s	remaining: 38.3s
681:	learn: 0.2729787	total: 1m 21s	remaining: 38.2s
682:	learn: 0.2728561	total: 1m 21s	remaining: 38s
683:	learn: 0.2727930	total: 1m 22s	remaining: 37.9s
684:	learn: 0.2726617	total: 1m 22s	remaining: 37.8s
685:	learn: 0.2725640	total: 1m 22s	remaining: 37.6s
686:	learn: 0.2723489	total: 1m 22s	remaining: 37.5s
687:	learn: 0.2722537	total: 1m 22s	remaining: 37.4s
688:	learn: 0.2721695	total: 1m 22s	remaining: 37.3s
689:	learn: 0.2720592	total: 1m 22s	remaining: 37.2s
690:	learn: 0.2719719	total: 1m 22s	remaining: 37.1s
691:	learn: 0.2718895	total: 1m 22s	remaining: 36.9s
692:	learn: 0.2718085	total: 1m 23s	remaining: 36.8s
693:	learn: 0.2717098	total: 1m 23s	remaining: 36.7s
694:	learn: 0.2715844	total: 1m 23s	remaining: 36.6s
695:	learn: 0.2714810	total: 1m 23s	remaining: 36.5s
696:	learn: 0.2713569	total: 1m 23s	remaining: 36.4s
697:	learn: 0.2712598	total: 1m 23s	remaining: 36.2s
698:	learn: 0.2711470	total: 1m 23s	remaining: 36.1s
699:	learn: 0.2710170	total: 1m 24s	remaining: 36s
700:	learn: 0.2708777	total: 1m 24s	remaining: 35.9s
701:	learn: 0.2707372	total: 1m 24s	remaining: 35.8s
702:	learn: 0.2706282	total: 1m 24s	remaining: 35.6s
703:	learn: 0.2705216	total: 1m 24s	remaining: 35.5s
704:	learn: 0.2704333	total: 1m 24s	remaining: 35.4s
705:	learn: 0.2702805	total: 1m 24s	remaining: 35.3s
706:	learn: 0.2701447	total: 1m 24s	remaining: 35.2s
707:	learn: 0.2700557	total: 1m 24s	remaining: 35.1s
708:	learn: 0.2699715	total: 1m 25s	remaining: 34.9s
709:	learn: 0.2698640	total: 1m 25s	remaining: 34.8s
710:	learn: 0.2697499	total: 1m 25s	remaining: 34.7s
711:	learn: 0.2696055	total: 1m 25s	remaining: 34.6s
712:	learn: 0.2695027	total: 1m 25s	remaining: 34.5s
713:	learn: 0.2694409	total: 1m 25s	remaining: 34.3s
714:	learn: 0.2693706	total: 1m 25s	remaining: 34.2s
715:	learn: 0.2693024	total: 1m 25s	remaining: 34.1s
716:	learn: 0.2692343	total: 1m 26s	remaining: 34s
717:	learn: 0.2691508	total: 1m 26s	remaining: 33.8s
718:	learn: 0.2690600	total: 1m 26s	remaining: 33.7s
719:	learn: 0.2689829	total: 1m 26s	remaining: 33.6s
720:	learn: 0.2688418	total: 1m 26s	remaining: 33.5s
721:	learn: 0.2687252	total: 1m 26s	remaining: 33.4s
722:	learn: 0.2686715	total: 1m 26s	remaining: 33.2s
723:	learn: 0.2685685	total: 1m 26s	remaining: 33.1s
724:	learn: 0.2684735	total: 1m 27s	remaining: 33s
725:	learn: 0.2683213	total: 1m 27s	remaining: 32.9s
726:	learn: 0.2681999	total: 1m 27s	remaining: 32.8s
727:	learn: 0.2680755	total: 1m 27s	remaining: 32.6s
728:	learn: 0.2679875	total: 1m 27s	remaining: 32.5s
729:	learn: 0.2678501	total: 1m 27s	remaining: 32.4s
730:	learn: 0.2677609	total: 1m 27s	remaining: 32.3s
731:	learn: 0.2676366	total: 1m 27s	remaining: 32.2s
732:	learn: 0.2675157	total: 1m 27s	remaining: 32s
733:	learn: 0.2674270	total: 1m 28s	remaining: 31.9s
734:	learn: 0.2673273	total: 1m 28s	remaining: 31.8s
735:	learn: 0.2671975	total: 1m 28s	remaining: 31.7s
736:	learn: 0.2671066	total: 1m 28s	remaining: 31.6s
737:	learn: 0.2670048	total: 1m 28s	remaining: 31.5s
738:	learn: 0.2669476	total: 1m 28s	remaining: 31.3s
739:	learn: 0.2669087	total: 1m 28s	remaining: 31.2s
740:	learn: 0.2667910	total: 1m 28s	remaining: 31.1s
741:	learn: 0.2666596	total: 1m 29s	remaining: 31s
742:	learn: 0.2666083	total: 1m 29s	remaining: 30.8s
743:	learn: 0.2665677	total: 1m 29s	remaining: 30.7s
744:	learn: 0.2664872	total: 1m 29s	remaining: 30.6s
745:	learn: 0.2664095	total: 1m 29s	remaining: 30.5s
746:	learn: 0.2663747	total: 1m 29s	remaining: 30.3s
747:	learn: 0.2662307	total: 1m 29s	remaining: 30.2s
748:	learn: 0.2661119	total: 1m 29s	remaining: 30.1s
749:	learn: 0.2660527	total: 1m 29s	remaining: 30s
750:	learn: 0.2659337	total: 1m 30s	remaining: 29.9s
751:	learn: 0.2658679	total: 1m 30s	remaining: 29.7s
752:	learn: 0.2657910	total: 1m 30s	remaining: 29.6s
753:	learn: 0.2656261	total: 1m 30s	remaining: 29.5s
754:	learn: 0.2655719	total: 1m 30s	remaining: 29.4s
755:	learn: 0.2654625	total: 1m 30s	remaining: 29.3s
756:	learn: 0.2653718	total: 1m 30s	remaining: 29.1s
757:	learn: 0.2651666	total: 1m 30s	remaining: 29s
758:	learn: 0.2650722	total: 1m 31s	remaining: 28.9s
759:	learn: 0.2650061	total: 1m 31s	remaining: 28.8s
760:	learn: 0.2649102	total: 1m 31s	remaining: 28.7s
761:	learn: 0.2648766	total: 1m 31s	remaining: 28.5s
762:	learn: 0.2648171	total: 1m 31s	remaining: 28.4s
763:	learn: 0.2647639	total: 1m 31s	remaining: 28.3s
764:	learn: 0.2645797	total: 1m 31s	remaining: 28.2s
765:	learn: 0.2644693	total: 1m 31s	remaining: 28.1s
766:	learn: 0.2642957	total: 1m 31s	remaining: 27.9s
767:	learn: 0.2641832	total: 1m 32s	remaining: 27.8s
768:	learn: 0.2640629	total: 1m 32s	remaining: 27.7s
769:	learn: 0.2639459	total: 1m 32s	remaining: 27.6s
770:	learn: 0.2638029	total: 1m 32s	remaining: 27.5s
771:	learn: 0.2636875	total: 1m 32s	remaining: 27.4s
772:	learn: 0.2635961	total: 1m 32s	remaining: 27.2s
773:	learn: 0.2634521	total: 1m 32s	remaining: 27.1s
774:	learn: 0.2633903	total: 1m 32s	remaining: 27s
775:	learn: 0.2633291	total: 1m 33s	remaining: 26.9s
776:	learn: 0.2632330	total: 1m 33s	remaining: 26.7s
777:	learn: 0.2631506	total: 1m 33s	remaining: 26.6s
778:	learn: 0.2630992	total: 1m 33s	remaining: 26.5s
779:	learn: 0.2630327	total: 1m 33s	remaining: 26.4s
780:	learn: 0.2629724	total: 1m 33s	remaining: 26.3s
781:	learn: 0.2628518	total: 1m 33s	remaining: 26.1s
782:	learn: 0.2627231	total: 1m 33s	remaining: 26s
783:	learn: 0.2626573	total: 1m 34s	remaining: 25.9s
784:	learn: 0.2625570	total: 1m 34s	remaining: 25.8s
785:	learn: 0.2624536	total: 1m 34s	remaining: 25.7s
786:	learn: 0.2623655	total: 1m 34s	remaining: 25.5s
787:	learn: 0.2622892	total: 1m 34s	remaining: 25.4s
788:	learn: 0.2621706	total: 1m 34s	remaining: 25.3s
789:	learn: 0.2620832	total: 1m 34s	remaining: 25.2s
790:	learn: 0.2620169	total: 1m 34s	remaining: 25.1s
791:	learn: 0.2619382	total: 1m 34s	remaining: 24.9s
792:	learn: 0.2618569	total: 1m 35s	remaining: 24.8s
793:	learn: 0.2617983	total: 1m 35s	remaining: 24.7s
794:	learn: 0.2617581	total: 1m 35s	remaining: 24.6s
795:	learn: 0.2616390	total: 1m 35s	remaining: 24.4s
796:	learn: 0.2615578	total: 1m 35s	remaining: 24.3s
797:	learn: 0.2614338	total: 1m 35s	remaining: 24.2s
798:	learn: 0.2613303	total: 1m 35s	remaining: 24.1s
799:	learn: 0.2612247	total: 1m 35s	remaining: 24s
800:	learn: 0.2611510	total: 1m 36s	remaining: 23.9s
801:	learn: 0.2610841	total: 1m 36s	remaining: 23.7s
802:	learn: 0.2609704	total: 1m 36s	remaining: 23.6s
803:	learn: 0.2608957	total: 1m 36s	remaining: 23.5s
804:	learn: 0.2608321	total: 1m 36s	remaining: 23.4s
805:	learn: 0.2607136	total: 1m 36s	remaining: 23.2s
806:	learn: 0.2606618	total: 1m 36s	remaining: 23.1s
807:	learn: 0.2605647	total: 1m 36s	remaining: 23s
808:	learn: 0.2604683	total: 1m 36s	remaining: 22.9s
809:	learn: 0.2603978	total: 1m 37s	remaining: 22.8s
810:	learn: 0.2603139	total: 1m 37s	remaining: 22.6s
811:	learn: 0.2602441	total: 1m 37s	remaining: 22.5s
812:	learn: 0.2601678	total: 1m 37s	remaining: 22.4s
813:	learn: 0.2601003	total: 1m 37s	remaining: 22.3s
814:	learn: 0.2599958	total: 1m 37s	remaining: 22.2s
815:	learn: 0.2598885	total: 1m 37s	remaining: 22s
816:	learn: 0.2597528	total: 1m 37s	remaining: 21.9s
817:	learn: 0.2596286	total: 1m 37s	remaining: 21.8s
818:	learn: 0.2595514	total: 1m 38s	remaining: 21.7s
819:	learn: 0.2594603	total: 1m 38s	remaining: 21.6s
820:	learn: 0.2593650	total: 1m 38s	remaining: 21.4s
821:	learn: 0.2592737	total: 1m 38s	remaining: 21.3s
822:	learn: 0.2591771	total: 1m 38s	remaining: 21.2s
823:	learn: 0.2590782	total: 1m 38s	remaining: 21.1s
824:	learn: 0.2590017	total: 1m 38s	remaining: 21s
825:	learn: 0.2588654	total: 1m 38s	remaining: 20.8s
826:	learn: 0.2587822	total: 1m 39s	remaining: 20.7s
827:	learn: 0.2586956	total: 1m 39s	remaining: 20.6s
828:	learn: 0.2585242	total: 1m 39s	remaining: 20.5s
829:	learn: 0.2584532	total: 1m 39s	remaining: 20.4s
830:	learn: 0.2583683	total: 1m 39s	remaining: 20.2s
831:	learn: 0.2582744	total: 1m 39s	remaining: 20.1s
832:	learn: 0.2582080	total: 1m 39s	remaining: 20s
833:	learn: 0.2581509	total: 1m 39s	remaining: 19.9s
834:	learn: 0.2580479	total: 1m 40s	remaining: 19.8s
835:	learn: 0.2579430	total: 1m 40s	remaining: 19.6s
836:	learn: 0.2578553	total: 1m 40s	remaining: 19.5s
837:	learn: 0.2577923	total: 1m 40s	remaining: 19.4s
838:	learn: 0.2576717	total: 1m 40s	remaining: 19.3s
839:	learn: 0.2575458	total: 1m 40s	remaining: 19.2s
840:	learn: 0.2574905	total: 1m 40s	remaining: 19s
841:	learn: 0.2574188	total: 1m 40s	remaining: 18.9s
842:	learn: 0.2573529	total: 1m 40s	remaining: 18.8s
843:	learn: 0.2572772	total: 1m 41s	remaining: 18.7s
844:	learn: 0.2571220	total: 1m 41s	remaining: 18.6s
845:	learn: 0.2570200	total: 1m 41s	remaining: 18.4s
846:	learn: 0.2569142	total: 1m 41s	remaining: 18.3s
847:	learn: 0.2567862	total: 1m 41s	remaining: 18.2s
848:	learn: 0.2566755	total: 1m 41s	remaining: 18.1s
849:	learn: 0.2565703	total: 1m 41s	remaining: 18s
850:	learn: 0.2564352	total: 1m 41s	remaining: 17.8s
851:	learn: 0.2563565	total: 1m 41s	remaining: 17.7s
852:	learn: 0.2562867	total: 1m 42s	remaining: 17.6s
853:	learn: 0.2561852	total: 1m 42s	remaining: 17.5s
854:	learn: 0.2561198	total: 1m 42s	remaining: 17.4s
855:	learn: 0.2560137	total: 1m 42s	remaining: 17.2s
856:	learn: 0.2558933	total: 1m 42s	remaining: 17.1s
857:	learn: 0.2557535	total: 1m 42s	remaining: 17s
858:	learn: 0.2556662	total: 1m 42s	remaining: 16.9s
859:	learn: 0.2555747	total: 1m 42s	remaining: 16.8s
860:	learn: 0.2555197	total: 1m 43s	remaining: 16.6s
861:	learn: 0.2554422	total: 1m 43s	remaining: 16.5s
862:	learn: 0.2553293	total: 1m 43s	remaining: 16.4s
863:	learn: 0.2552338	total: 1m 43s	remaining: 16.3s
864:	learn: 0.2551471	total: 1m 43s	remaining: 16.2s
865:	learn: 0.2550556	total: 1m 43s	remaining: 16s
866:	learn: 0.2549429	total: 1m 43s	remaining: 15.9s
867:	learn: 0.2548859	total: 1m 43s	remaining: 15.8s
868:	learn: 0.2548297	total: 1m 44s	remaining: 15.7s
869:	learn: 0.2547743	total: 1m 44s	remaining: 15.6s
870:	learn: 0.2546251	total: 1m 44s	remaining: 15.4s
871:	learn: 0.2544888	total: 1m 44s	remaining: 15.3s
872:	learn: 0.2543755	total: 1m 44s	remaining: 15.2s
873:	learn: 0.2542848	total: 1m 44s	remaining: 15.1s
874:	learn: 0.2542183	total: 1m 44s	remaining: 15s
875:	learn: 0.2541466	total: 1m 44s	remaining: 14.9s
876:	learn: 0.2540531	total: 1m 45s	remaining: 14.7s
877:	learn: 0.2539442	total: 1m 45s	remaining: 14.6s
878:	learn: 0.2539201	total: 1m 45s	remaining: 14.5s
879:	learn: 0.2538184	total: 1m 45s	remaining: 14.4s
880:	learn: 0.2537119	total: 1m 45s	remaining: 14.3s
881:	learn: 0.2536166	total: 1m 45s	remaining: 14.1s
882:	learn: 0.2535280	total: 1m 45s	remaining: 14s
883:	learn: 0.2534260	total: 1m 45s	remaining: 13.9s
884:	learn: 0.2533355	total: 1m 46s	remaining: 13.8s
885:	learn: 0.2532276	total: 1m 46s	remaining: 13.7s
886:	learn: 0.2531322	total: 1m 46s	remaining: 13.5s
887:	learn: 0.2530437	total: 1m 46s	remaining: 13.4s
888:	learn: 0.2529085	total: 1m 46s	remaining: 13.3s
889:	learn: 0.2528284	total: 1m 46s	remaining: 13.2s
890:	learn: 0.2527314	total: 1m 46s	remaining: 13.1s
891:	learn: 0.2526792	total: 1m 46s	remaining: 12.9s
892:	learn: 0.2526163	total: 1m 46s	remaining: 12.8s
893:	learn: 0.2525254	total: 1m 47s	remaining: 12.7s
894:	learn: 0.2524125	total: 1m 47s	remaining: 12.6s
895:	learn: 0.2523133	total: 1m 47s	remaining: 12.5s
896:	learn: 0.2522692	total: 1m 47s	remaining: 12.3s
897:	learn: 0.2521934	total: 1m 47s	remaining: 12.2s
898:	learn: 0.2521103	total: 1m 47s	remaining: 12.1s
899:	learn: 0.2519893	total: 1m 47s	remaining: 12s
900:	learn: 0.2519296	total: 1m 47s	remaining: 11.9s
901:	learn: 0.2517642	total: 1m 48s	remaining: 11.7s
902:	learn: 0.2516998	total: 1m 48s	remaining: 11.6s
903:	learn: 0.2516308	total: 1m 48s	remaining: 11.5s
904:	learn: 0.2515256	total: 1m 48s	remaining: 11.4s
905:	learn: 0.2514695	total: 1m 48s	remaining: 11.3s
906:	learn: 0.2513786	total: 1m 48s	remaining: 11.1s
907:	learn: 0.2513060	total: 1m 48s	remaining: 11s
908:	learn: 0.2512321	total: 1m 48s	remaining: 10.9s
909:	learn: 0.2511617	total: 1m 48s	remaining: 10.8s
910:	learn: 0.2510609	total: 1m 49s	remaining: 10.7s
911:	learn: 0.2509307	total: 1m 49s	remaining: 10.5s
912:	learn: 0.2508357	total: 1m 49s	remaining: 10.4s
913:	learn: 0.2507787	total: 1m 49s	remaining: 10.3s
914:	learn: 0.2506997	total: 1m 49s	remaining: 10.2s
915:	learn: 0.2506097	total: 1m 49s	remaining: 10.1s
916:	learn: 0.2505472	total: 1m 49s	remaining: 9.94s
917:	learn: 0.2504329	total: 1m 49s	remaining: 9.82s
918:	learn: 0.2503636	total: 1m 50s	remaining: 9.7s
919:	learn: 0.2502863	total: 1m 50s	remaining: 9.58s
920:	learn: 0.2502391	total: 1m 50s	remaining: 9.46s
921:	learn: 0.2501374	total: 1m 50s	remaining: 9.34s
922:	learn: 0.2500339	total: 1m 50s	remaining: 9.22s
923:	learn: 0.2499587	total: 1m 50s	remaining: 9.1s
924:	learn: 0.2498476	total: 1m 50s	remaining: 8.98s
925:	learn: 0.2497534	total: 1m 50s	remaining: 8.87s
926:	learn: 0.2496172	total: 1m 51s	remaining: 8.74s
927:	learn: 0.2495097	total: 1m 51s	remaining: 8.63s
928:	learn: 0.2493981	total: 1m 51s	remaining: 8.51s
929:	learn: 0.2493573	total: 1m 51s	remaining: 8.38s
930:	learn: 0.2492981	total: 1m 51s	remaining: 8.26s
931:	learn: 0.2492359	total: 1m 51s	remaining: 8.14s
932:	learn: 0.2491896	total: 1m 51s	remaining: 8.02s
933:	learn: 0.2491188	total: 1m 51s	remaining: 7.9s
934:	learn: 0.2490341	total: 1m 51s	remaining: 7.78s
935:	learn: 0.2489562	total: 1m 52s	remaining: 7.66s
936:	learn: 0.2488408	total: 1m 52s	remaining: 7.54s
937:	learn: 0.2487565	total: 1m 52s	remaining: 7.42s
938:	learn: 0.2486582	total: 1m 52s	remaining: 7.3s
939:	learn: 0.2485191	total: 1m 52s	remaining: 7.19s
940:	learn: 0.2484647	total: 1m 52s	remaining: 7.07s
941:	learn: 0.2483495	total: 1m 52s	remaining: 6.95s
942:	learn: 0.2482504	total: 1m 52s	remaining: 6.83s
943:	learn: 0.2481684	total: 1m 53s	remaining: 6.71s
944:	learn: 0.2481123	total: 1m 53s	remaining: 6.59s
945:	learn: 0.2480769	total: 1m 53s	remaining: 6.47s
946:	learn: 0.2479641	total: 1m 53s	remaining: 6.35s
947:	learn: 0.2478607	total: 1m 53s	remaining: 6.23s
948:	learn: 0.2477816	total: 1m 53s	remaining: 6.11s
949:	learn: 0.2476935	total: 1m 53s	remaining: 5.99s
950:	learn: 0.2476025	total: 1m 53s	remaining: 5.87s
951:	learn: 0.2475447	total: 1m 54s	remaining: 5.75s
952:	learn: 0.2474617	total: 1m 54s	remaining: 5.63s
953:	learn: 0.2473844	total: 1m 54s	remaining: 5.51s
954:	learn: 0.2473263	total: 1m 54s	remaining: 5.39s
955:	learn: 0.2472864	total: 1m 54s	remaining: 5.27s
956:	learn: 0.2472020	total: 1m 54s	remaining: 5.15s
957:	learn: 0.2471121	total: 1m 54s	remaining: 5.03s
958:	learn: 0.2470085	total: 1m 54s	remaining: 4.91s
959:	learn: 0.2469662	total: 1m 54s	remaining: 4.79s
960:	learn: 0.2468905	total: 1m 55s	remaining: 4.67s
961:	learn: 0.2468381	total: 1m 55s	remaining: 4.55s
962:	learn: 0.2467814	total: 1m 55s	remaining: 4.43s
963:	learn: 0.2467363	total: 1m 55s	remaining: 4.31s
964:	learn: 0.2466676	total: 1m 55s	remaining: 4.19s
965:	learn: 0.2465674	total: 1m 55s	remaining: 4.08s
966:	learn: 0.2464593	total: 1m 56s	remaining: 3.97s
967:	learn: 0.2463950	total: 1m 56s	remaining: 3.86s
968:	learn: 0.2463205	total: 1m 56s	remaining: 3.74s
969:	learn: 0.2462748	total: 1m 56s	remaining: 3.62s
970:	learn: 0.2461844	total: 1m 57s	remaining: 3.5s
971:	learn: 0.2461218	total: 1m 57s	remaining: 3.38s
972:	learn: 0.2460723	total: 1m 57s	remaining: 3.25s
973:	learn: 0.2460133	total: 1m 57s	remaining: 3.13s
974:	learn: 0.2459586	total: 1m 57s	remaining: 3.01s
975:	learn: 0.2458414	total: 1m 57s	remaining: 2.89s
976:	learn: 0.2457613	total: 1m 57s	remaining: 2.77s
977:	learn: 0.2457067	total: 1m 57s	remaining: 2.65s
978:	learn: 0.2455437	total: 1m 58s	remaining: 2.53s
979:	learn: 0.2454479	total: 1m 58s	remaining: 2.41s
980:	learn: 0.2453969	total: 1m 58s	remaining: 2.29s
981:	learn: 0.2452974	total: 1m 58s	remaining: 2.17s
982:	learn: 0.2451741	total: 1m 58s	remaining: 2.05s
983:	learn: 0.2450990	total: 1m 58s	remaining: 1.93s
984:	learn: 0.2450057	total: 1m 58s	remaining: 1.81s
985:	learn: 0.2449012	total: 1m 58s	remaining: 1.69s
986:	learn: 0.2448297	total: 1m 59s	remaining: 1.57s
987:	learn: 0.2447372	total: 1m 59s	remaining: 1.45s
988:	learn: 0.2446193	total: 1m 59s	remaining: 1.33s
989:	learn: 0.2445271	total: 1m 59s	remaining: 1.21s
990:	learn: 0.2444311	total: 1m 59s	remaining: 1.09s
991:	learn: 0.2443492	total: 1m 59s	remaining: 966ms
992:	learn: 0.2442331	total: 1m 59s	remaining: 845ms
993:	learn: 0.2441775	total: 1m 59s	remaining: 724ms
994:	learn: 0.2441002	total: 2m	remaining: 603ms
995:	learn: 0.2439637	total: 2m	remaining: 483ms
996:	learn: 0.2438835	total: 2m	remaining: 362ms
997:	learn: 0.2437798	total: 2m	remaining: 241ms
998:	learn: 0.2437329	total: 2m	remaining: 121ms
999:	learn: 0.2436857	total: 2m	remaining: 0us
0.9054992599339633

Explainability

Explainability of the models is important so we can understand how and why the model has made certain predictions. For this, we can obtain SHAP values.

In [ ]:
prediction = model.predict(X_test.values)

for i in range(5):
    data_for_prediction = X_test.iloc[[i]]  
    explainer = shap.TreeExplainer(model)
    shap_values = explainer.shap_values(data_for_prediction.values)
    shap.initjs()
    plt = shap.force_plot(explainer.expected_value[0], shap_values[0], data_for_prediction)
    display(plt)
Visualization omitted, Javascript library not loaded!
Have you run `initjs()` in this notebook? If this notebook was from another user you must also trust this notebook (File -> Trust notebook). If you are viewing this notebook on github the Javascript has been stripped for security. If you are using JupyterLab this error is because a JupyterLab extension has not yet been written.
Visualization omitted, Javascript library not loaded!
Have you run `initjs()` in this notebook? If this notebook was from another user you must also trust this notebook (File -> Trust notebook). If you are viewing this notebook on github the Javascript has been stripped for security. If you are using JupyterLab this error is because a JupyterLab extension has not yet been written.
Visualization omitted, Javascript library not loaded!
Have you run `initjs()` in this notebook? If this notebook was from another user you must also trust this notebook (File -> Trust notebook). If you are viewing this notebook on github the Javascript has been stripped for security. If you are using JupyterLab this error is because a JupyterLab extension has not yet been written.
Visualization omitted, Javascript library not loaded!
Have you run `initjs()` in this notebook? If this notebook was from another user you must also trust this notebook (File -> Trust notebook). If you are viewing this notebook on github the Javascript has been stripped for security. If you are using JupyterLab this error is because a JupyterLab extension has not yet been written.
Visualization omitted, Javascript library not loaded!
Have you run `initjs()` in this notebook? If this notebook was from another user you must also trust this notebook (File -> Trust notebook). If you are viewing this notebook on github the Javascript has been stripped for security. If you are using JupyterLab this error is because a JupyterLab extension has not yet been written.
In [ ]:
explainer = shap.TreeExplainer(model)    
shap_values = explainer.shap_values(X_test.values)
plt = shap.summary_plot(shap_values, X_test, max_display=X_test.shape[1])
display(plt)
None

🖼️ Visualisations

Copy here the most important visualizations (graphs, charts, maps, images, etc). You can refer to them in the Executive Summary.

Technical note: If not all the visualisations are visible, you can still include them as an image or link - in this case please upload them to your own repository.

NO2 Trend

In [ ]:
rcParams['figure.figsize'] = 18, 8
plt.figure(num=None, figsize=(50, 20), dpi=80, facecolor='w', edgecolor='k')
series = df.NO2
result = seasonal_decompose(series, model='multiplicative', freq = 8760)
res = result.plot()
<Figure size 4000x1600 with 0 Axes>

CAQI

caqi.PNG

CAQI Analysis

In [22]:
palette = cycle(px.colors.sequential.Viridis)
df_graph = df[['timestamp_measured', 'CAQI']]
df2015 = df_graph[df_graph['timestamp_measured'].dt.year == 2015]
df2019 = df_graph[df_graph['timestamp_measured'].dt.year == 2019]
df2020 = df_graph[df_graph['timestamp_measured'].dt.year == 2020]
df2021 = df_graph[df_graph['timestamp_measured'].dt.year == 2021]

# chart
fig = make_subplots(rows=4, cols=2, 
                    specs=[[{"type": "bar"}, {"type": "scatter"}], [{"colspan": 2}, None], [{"colspan": 2}, None], [{'type':'indicator'}, {'type':'bar'}]],
                    column_widths=[0.4, 0.6], vertical_spacing=0.1, horizontal_spacing=0.1,
                    subplot_titles=("Mean CAQI per Day of Week", "Hourly CAQI Trend", "Daily CAQI Trend", "2020 vs 2021", "Worst day: 1st of January 2019","CAQI Hourly Value Counts"))

# Upper Left chart
df_day = df_graph.groupby([df_graph["timestamp_measured"].dt.weekday]).mean().reset_index().sort_values(by='CAQI', ascending = False)
values = list(range(7))
fig.add_trace(go.Bar(x=df_day["timestamp_measured"], y=df_day['CAQI'], marker = dict(color=values, colorscale="Viridis"), 
                     name = 'Day of Week'),
                      row=1, col=1)

fig.update_xaxes(showgrid = False, linecolor='gray', linewidth = 2, zeroline = False, row=1, col=1)
fig.update_yaxes(showgrid = False, linecolor='gray',linewidth=2, zeroline = False, row=1, col=1)

# Upper Right chart
df_hour = df_graph.groupby([df_graph["timestamp_measured"].dt.hour]).mean().reset_index('timestamp_measured')
fig.add_trace(go.Scatter(x=df_hour["timestamp_measured"], y=df_hour['CAQI'], mode='lines+markers',
               name='Hourly CAQI'), row = 1, col = 2)

# Rectangle to highlight range
fig.add_vrect(x0=5, x1=12,
              fillcolor=px.colors.sequential.Viridis[4],
              layer="below", 
              opacity=0.25, 
              line_width=0, 
              row = 1, col = 2
)

fig.add_annotation(dict(
        x=7,
        y=df_hour.loc[8,'CAQI']+0.004,
        text="There is a <b>peak at <br>7am</b> coinciding with<br>going to work.",
        ax="-20",
        ay="-60",
        showarrow = True,
        arrowhead = 7,
        arrowwidth = 0.7
), row=1, col=2)

fig.add_annotation(dict(
        x=8.5,
        y=1.45,
        text="Morning hours are <br><b>the rush hours</b>.",
        showarrow = False
), row=1, col=2)

fig.add_annotation(dict(
        x=16,
        y=1.39,
        text="From 4pm <br> <b>CAQI<br> rises slightly again</b>.",
        ax="0",
        ay="-100",
        showarrow = True,
        arrowhead = 7,
        arrowwidth = 0.7
), row=1, col=2)

fig.update_xaxes(showgrid = False, linecolor='gray', linewidth = 2, zeroline = False, row=1, col=2)
fig.update_yaxes(showgrid = False, linecolor='gray', linewidth=2, row=1, col=2)

# Medium Chart
df_week = df_graph.groupby([df_graph["timestamp_measured"].dt.dayofyear]).mean().reset_index()
fig.add_trace(go.Scatter(x = df_week["timestamp_measured"], y = df_week['CAQI'], mode='lines',
                        marker = dict(color = px.colors.sequential.Viridis[5]),
                        name='Daily CAQI'), row = 2, col = 1)

from statsmodels.tsa.seasonal import seasonal_decompose
decomp = seasonal_decompose(df_week['CAQI'], model='additive', freq = 21)

fig.add_trace(go.Scatter(x = df_week["timestamp_measured"], y = decomp.trend, mode='lines',
                       marker = dict(color = medium),
                        name='CAQI Trend'), row = 2, col = 1)
    
fig.update_xaxes(showgrid = False, linecolor='gray', linewidth = 2, row=2, col=1)
fig.update_yaxes(gridcolor = 'gray', gridwidth = 0.15, linecolor='gray',linewidth=2, row=2, col=1)


df_week2015= df2015.groupby([df2015["timestamp_measured"].dt.dayofyear]).mean().reset_index()
fig.add_trace(go.Scatter(x = df_week2015["timestamp_measured"], y = df_week2015['CAQI'], mode='lines',
                         marker = dict(color = px.colors.sequential.Viridis[5]),
                         name='2015'), row = 3, col = 1)


df_week2021 = df2021.groupby([df2021["timestamp_measured"].dt.dayofyear]).mean().reset_index()
fig.add_trace(go.Scatter(x = df_week2021["timestamp_measured"], y = df_week2021['CAQI'], mode='lines',
                        marker = dict(color = px.colors.sequential.Viridis[8]),
                        name='2021'), row = 3, col = 1)

# Left Bottom Chart
fig.add_trace(go.Indicator(mode = "number", value = 537, title = 'The first hours of New Year always have bad air quality ', number = {'prefix': "PM10 "},), row = 4, col = 1)

# Right Bottom Chart
counts = df_graph['CAQI'].value_counts(ascending=False)
fig.add_trace(go.Bar(x=counts, y=['Very Low', 'Low', 'Medium', 'High', 'Very High'], marker = dict(color=colors), name = 'CAQI Values', orientation = 'h'),
                      row=4, col=2)

fig.update_xaxes(showgrid = False, linecolor='gray', linewidth = 2, zeroline = False, row=3, col=2)
fig.update_yaxes(showgrid = False, linecolor='gray',linewidth=2, zeroline = False, row=3, col=2)

fig.add_annotation(dict(
        x=33+0.15,
        y='Very High',
        text="Highest CAQI <br> are <b> more unusual</b>.",
        ax="110",
        ay="-20",
        showarrow = True,
        arrowhead = 7,
        arrowwidth = 0.7
), row=4, col=2)

# General Styling
fig.update_layout(height=1300, width=1300, bargap=0.2,
                  margin=dict(b=50,r=30,l=100),
                  title = "<span style='font-size:36px; font-family:Times New Roman'>CAQI Analysis</span>",                  
                  plot_bgcolor='rgb(242,242,242)',
                  paper_bgcolor = 'rgb(242,242,242)',
                  font=dict(family="Times New Roman", size= 14),
                  hoverlabel=dict(font_color="floralwhite"),
                  showlegend=False)
fig.show()

df20 = df_graph[df_graph['timestamp_measured'].dt.year >= 2019]
z = df20.groupby([df20["timestamp_measured"].dt.date])['CAQI'].mean()
display_years(z, (2019, 2020, 2021))
024600.511.5051015201.41.51.61.75010015020025030035011.52501001502002503003501234010k20k30k40kVery LowLowMediumHighVery HighPM10 537The first hours of New Year always have bad air quality CAQI AnalysisMean CAQI per Day of WeekHourly CAQI TrendDaily CAQI Trend2020 vs 2021Worst day: 1st of January 2019CAQI Hourly Value CountsThere is a peak at 7am coinciding withgoing to work.Morning hours are the rush hours.From 4pm CAQI rises slightly again.Highest CAQI are more unusual.
JanFebMarAprMayJunJulAugSepOctNovDecMonTueWedThuFriSatSunJanFebMarAprMayJunJulAugSepOctNovDecMonTueWedThuFriSatSunJanFebMarAprMayJunJulAugSepOctNovDecMonTueWedThuFriSatSunCAQI in the last 3 years201920202021

⏭️ Appendix

In [ ]:

Dickey-Fuller test and correlations

In [ ]:
def tsplot(y, lags=None, figsize=(12, 7), syle='bmh'):
    if not isinstance(y, pd.Series):
        y = pd.Series(y)

    with plt.style.context(style='bmh'):
        fig = plt.figure(figsize=(12, 7))
        layout = (3, 2)
        ts_ax = plt.subplot2grid(layout, (0, 0), colspan=2)
        acf_ax = plt.subplot2grid(layout, (1, 0))
        pacf_ax = plt.subplot2grid(layout, (1, 1))
        mean_std_ax = plt.subplot2grid(layout, (2, 0), colspan=2)
        y.plot(ax=ts_ax)
        p_value = sm.tsa.stattools.adfuller(y)[1]
        hypothesis_result = "We reject stationarity" if p_value <= 0.05 else "We can not reject stationarity"
        ts_ax.set_title(
            'Time Series stationary analysis Plots\n Dickey-Fuller: p={0:.5f} Result: {1}'.format(p_value, hypothesis_result))
        smt.graphics.plot_acf(y, lags=lags, ax=acf_ax)
        smt.graphics.plot_pacf(y, lags=lags, ax=pacf_ax)
        plt.tight_layout()

        rolmean = y.rolling(window=8760).mean()
        rolstd = y.rolling(window=8760).std()

        # Plot rolling statistics:
        orig = plt.plot(y, label='Original')
        mean = plt.plot(rolmean, color='red', label='Rolling Mean')
        std = plt.plot(rolstd, color='black', label='Rolling Std')
        plt.legend(loc='best')
        plt.title('Rolling Mean & Standard Deviation')
NO2
In [ ]:
tsplot(df.NO2, lags=30)
NO
In [ ]:
tsplot(df.NO, lags=30)
FN
In [ ]:
tsplot(df.FN, lags=30)
C7H8
In [ ]:
tsplot(df.C7H8, lags=30)
C6H6
In [ ]:
tsplot(df.C6H6, lags=30)
PM2.5
In [ ]:
tsplot(df.PM25, lags=30)
PM10
In [ ]:
tsplot(df.PM10, lags=30)
In [ ]:

Looking at seasonal components

Plots for the remaining pollutants

PCA

In [ ]:
def plot_variance(pca, width=8, dpi=100):
    # Create figure
    fig, axs = plt.subplots(2, 1)
    n = pca.n_components_
    grid = np.arange(1, n + 1)
    # Explained variance
    evr = pca.explained_variance_ratio_
    axs[0].bar(grid, evr)
    axs[0].set(
        xlabel="Component", title="% Explained Variance", ylim=(0.0, 0.2)
    )
    # Cumulative Variance
    cv = np.cumsum(evr)
    axs[1].plot(np.r_[0, grid], np.r_[0, cv], "o-")
    axs[1].set(
        xlabel="Component", title="% Cumulative Variance", ylim=(0.0, 1.0)
    )
    
    # Set up figure
    fig.set(figwidth=width, dpi=100)
    return axs
In [ ]:
X = df.copy()
X_t = df.copy()

y = X.pop('PM25')
X = X.loc[:, features]
X_t = X_t.loc[:, features]

from sklearn.decomposition import PCA

# Create principal components
pca = PCA()
X_pca = pca.fit_transform(X)
X_t_pca = pca.transform(X_t)

# Convert to dataframe
component_names = [f"PC{i+1}" for i in range(X_pca.shape[1])]
X_pca = pd.DataFrame(X_pca, columns=component_names)
X_t_pca = pd.DataFrame(X_t_pca, columns=component_names)

X_pca.head(3)
Out[ ]:
PC1 PC2 PC3 PC4 PC5 PC6 PC7 PC8 PC9 PC10 PC11
0 -78.456568 27.830894 18.620100 11.567243 -2.228581 2.110587 0.558017 -0.415846 -0.971011 -0.765919 0.220953
1 -62.563931 42.617926 8.226600 -10.412718 17.810346 -13.481167 -10.696555 4.969879 -2.083093 0.981662 -0.121546
2 -47.664954 48.548953 -9.640234 -20.605061 11.033128 6.729953 11.809898 -9.616620 -1.957614 1.008658 -0.491657
In [ ]:
loadings = pd.DataFrame(
    pca.components_.T,  # transpose the matrix of loadings
    columns=component_names,  # so the columns are the principal components
    index=X.columns,  # and the rows are the original features
)
loadings.head(6)
Out[ ]:
PC1 PC2 PC3 PC4 PC5 PC6 PC7 PC8 PC9 PC10 PC11
component_id
NO2_lag_hour_1 0.346364 0.290575 -0.282207 -0.524232 0.469221 -0.363802 -0.262064 0.125276 -0.063301 -0.013889 0.006817
NO2_lag_hour_2 0.368427 0.178299 -0.395443 -0.239301 -0.149779 0.463235 0.518123 -0.336651 -0.004892 0.000593 -0.000826
FN 0.014201 0.019321 0.008768 -0.006630 0.006395 -0.007711 -0.004196 0.002338 0.058135 0.775586 -0.627908
NO 0.302751 0.727561 0.572957 0.209706 -0.063379 0.033477 0.015753 -0.006531 -0.030131 -0.018131 0.008649
NO2_lag_hour_3 0.380026 0.021556 -0.356432 0.218821 -0.513850 0.132231 -0.395734 0.491988 -0.001752 -0.000160 -0.000770
NO2_lag_hour_4 0.380505 -0.142873 -0.174945 0.483420 -0.032924 -0.525285 -0.023183 -0.541250 0.002439 -0.000335 0.000728
In [ ]:
plot_variance(pca, width=6);
In [ ]:
df_train = pd.concat([df, X_pca], axis=1)
df_test = pd.concat([df, X_t_pca], axis=1)
In [ ]:
from catboost import CatBoostRegressor
import eli5
from eli5.sklearn import PermutationImportance

tst_start = pd.to_datetime('2016-01-01 00:00', unit="ns", utc=True)
tst_finish = pd.to_datetime('2016-12-31 23:00', unit="ns", utc=True)

valid_test = df_train[(df_train['timestamp_measured'] >= tst_start) & (df_train['timestamp_measured'] <= tst_finish)].drop(['PM25'], axis=1)
valid_train = df_train[df_train['timestamp_measured'] < tst_start]

tmp = df_train[(df_train['timestamp_measured'] >= tst_start) & (df_train['timestamp_measured'] <= tst_finish)]
valid_target = tmp.pop('PM25')
valid_sample_submission = tmp.copy()
valid_sample_submission['PM25'] = 50
valid_sample_submission = valid_sample_submission['PM25'] 

X_train = valid_train.copy()
X_train = X_train.drop(['timestamp_measured'], axis=1)
Y_train = X_train['PM25']
X_train = X_train.drop(['PM25'], axis=1)

X_test = valid_test.drop(['timestamp_measured'], axis=1)

model = CatBoostRegressor(logging_level='Silent', n_estimators=800, eval_metric='MAE', loss_function='MAE').fit(X_train.values, Y_train.values)
In [ ]:
import eli5
from eli5.sklearn import PermutationImportance

perm = PermutationImportance(model, random_state=1).fit(X_test, valid_target)
eli5.show_weights(perm, feature_names = X_test.columns.tolist(), top=None)
Out[ ]:
Weight Feature
0.4653 ± 0.0122 PM25_lag_hour_1
0.3865 ± 0.0171 PM10
0.0301 ± 0.0010 PM25_lag_hour_2
0.0128 ± 0.0015 PM25_lag_hour_3
0.0061 ± 0.0025 PM10_lag_hour_2
0.0054 ± 0.0003 month
0.0042 ± 0.0006 PC10
0.0033 ± 0.0014 PM25_lag_hour_4
0.0030 ± 0.0011 PM10_lag_hour_4
0.0028 ± 0.0007 PM10_lag_hour_1
0.0026 ± 0.0009 PM10_lag_hour_3
0.0021 ± 0.0023 hour
0.0019 ± 0.0014 PM25_lag_hour_7
0.0018 ± 0.0006 NO2_lag_hour_1
0.0018 ± 0.0008 PC11
0.0013 ± 0.0003 PM25_lag_hour_5
0.0011 ± 0.0007 FN
0.0011 ± 0.0008 PM25_lag_hour_6
0.0010 ± 0.0002 NO
0.0009 ± 0.0006 PM10_lag_hour_5
0.0009 ± 0.0006 NO2
0.0006 ± 0.0002 C6H6
0.0005 ± 0.0005 PM25_lag_1
0.0004 ± 0.0010 PM10_lag_1
0.0004 ± 0.0005 PC6
0.0004 ± 0.0005 PM10_lag_7
0.0004 ± 0.0002 PM10_lag_hour_6
0.0002 ± 0.0003 PC4
0.0002 ± 0.0004 NO2_lag_hour_2
0.0002 ± 0.0002 afternoon
0.0002 ± 0.0002 PC9
0.0002 ± 0.0001 PC3
0.0002 ± 0.0003 NO2_lag_hour_7
0.0002 ± 0.0002 NO2_lag_3
0.0001 ± 0.0002 NO2_lag_7
0.0001 ± 0.0005 NO2_lag_6
0.0001 ± 0.0001 PC2
0.0001 ± 0.0007 day
0.0001 ± 0.0001 NO2_lag_hour_5
0.0001 ± 0.0001 C7H8
0.0001 ± 0.0001 PM25_lag_5
0.0001 ± 0.0002 NO2_lag_hour_4
0.0001 ± 0.0005 weekday
0.0001 ± 0.0003 NO2_lag_2
0.0000 ± 0.0001 NO2_lag_5
0.0000 ± 0.0001 weekend
0.0000 ± 0.0001 PC5
0.0000 ± 0.0001 PC8
0.0000 ± 0.0001 PM10_lag_hour_7
0 ± 0.0000 year
-0.0000 ± 0.0001 PC1
-0.0000 ± 0.0000 PM25_lag_6
-0.0000 ± 0.0001 PC7
-0.0000 ± 0.0001 NO2_lag_hour_6
-0.0000 ± 0.0001 PM10_lag_3
-0.0000 ± 0.0001 PM10_lag_2
-0.0000 ± 0.0001 PM25_lag_3
-0.0001 ± 0.0002 PM25_lag_7
-0.0001 ± 0.0003 PM10_lag_5
-0.0001 ± 0.0005 NO2_lag_hour_3
-0.0001 ± 0.0002 PM25_lag_2
-0.0001 ± 0.0001 PM10_lag_6
-0.0001 ± 0.0002 PM25_lag_4
-0.0001 ± 0.0002 NO2_lag_4
-0.0003 ± 0.0003 NO2_lag_1
-0.0005 ± 0.0002 PM10_lag_4
-0.0010 ± 0.0013 week
NO
In [ ]:
rcParams['figure.figsize'] = 18, 8
plt.figure(num=None, figsize=(50, 20), dpi=80, facecolor='w', edgecolor='k')
series = df.NO
result = seasonal_decompose(series, model='multiplicative', freq = 8760)
res = result.plot()
<Figure size 4000x1600 with 0 Axes>
FN
In [ ]:
rcParams['figure.figsize'] = 18, 8
plt.figure(num=None, figsize=(50, 20), dpi=80, facecolor='w', edgecolor='k')
series = df.FN
result = seasonal_decompose(series, model='multiplicative', freq = 8760)
res = result.plot()
<Figure size 4000x1600 with 0 Axes>
C7H8
In [ ]:
rcParams['figure.figsize'] = 18, 8
plt.figure(num=None, figsize=(50, 20), dpi=80, facecolor='w', edgecolor='k')
series = df.C7H8
result = seasonal_decompose(series, model='multiplicative', freq = 8760)
res = result.plot()
<Figure size 4000x1600 with 0 Axes>
C6H6
In [ ]:
rcParams['figure.figsize'] = 18, 8
plt.figure(num=None, figsize=(50, 20), dpi=80, facecolor='w', edgecolor='k')
series = df.C6H6
result = seasonal_decompose(series, model='multiplicative', freq = 8760)
res = result.plot()
<Figure size 4000x1600 with 0 Axes>
PM2.5
In [ ]:
rcParams['figure.figsize'] = 18, 8
plt.figure(num=None, figsize=(50, 20), dpi=80, facecolor='w', edgecolor='k')
series = df.PM25
result = seasonal_decompose(series, model='multiplicative', freq = 8760)
res = result.plot()
<Figure size 4000x1600 with 0 Axes>
PM10
In [ ]:
rcParams['figure.figsize'] = 18, 8
plt.figure(num=None, figsize=(50, 20), dpi=80, facecolor='w', edgecolor='k')
series = df.PM10
result = seasonal_decompose(series, model='multiplicative', freq = 8760)
res = result.plot()
<Figure size 4000x1600 with 0 Axes>

Permutation Importance

In [ ]:
from catboost import CatBoostRegressor
import eli5
from eli5.sklearn import PermutationImportance

tst_start = pd.to_datetime('2016-01-01 00:00', unit="ns", utc=True)
tst_finish = pd.to_datetime('2016-12-31 23:00', unit="ns", utc=True)

res = []
for t in targets:
  valid_test = df[(df['timestamp_measured'] >= tst_start) & (df['timestamp_measured'] <= tst_finish)].drop([t], axis=1)
  valid_train = df[df['timestamp_measured'] < tst_start]

  tmp = df[(df['timestamp_measured'] >= tst_start) & (df['timestamp_measured'] <= tst_finish)]
  valid_target = tmp.pop(t)

  X_train = valid_train.copy()
  X_train = X_train.drop(['timestamp_measured'], axis=1)
  Y_train = X_train[t]
  X_train = X_train.drop([t], axis=1)

  X_test = valid_test.drop(['timestamp_measured'], axis=1)

  model = CatBoostRegressor(logging_level='Silent', random_state=42, eval_metric='MAE', loss_function='MAE').fit(X_train.values, Y_train.values)
  perm = PermutationImportance(model, random_state=1).fit(X_test, valid_target)
  display(eli5.show_weights(perm, feature_names = X_test.columns.tolist(), top=None))
Weight Feature
0.5349 ± 0.0143 PM25
0.3336 ± 0.0080 PM10_lag_hour_1
0.0269 ± 0.0061 PM10_lag_hour_2
0.0122 ± 0.0032 NO2
0.0114 ± 0.0022 FN
0.0078 ± 0.0012 PM25_lag_hour_3
0.0060 ± 0.0009 PM25_lag_hour_2
0.0047 ± 0.0010 PM10_lag_hour_3
0.0043 ± 0.0011 PM25_lag_hour_1
0.0036 ± 0.0012 NO2_lag_hour_1
0.0028 ± 0.0009 PM25_lag_hour_4
0.0023 ± 0.0015 PM10_lag_hour_4
0.0022 ± 0.0003 NO2_lag_hour_2
0.0019 ± 0.0017 month
0.0015 ± 0.0010 PM25_lag_hour_6
0.0011 ± 0.0001 PM25_lag_hour_5
0.0011 ± 0.0001 NO2_lag_hour_3
0.0010 ± 0.0008 PM10_lag_hour_6
0.0009 ± 0.0003 PM10_lag_hour_5
0.0009 ± 0.0005 NO2_lag_hour_6
0.0008 ± 0.0008 PM25_lag_hour_7
0.0007 ± 0.0007 hour
0.0006 ± 0.0007 NO2_lag_hour_5
0.0006 ± 0.0004 NO
0.0005 ± 0.0004 PM10_lag_2
0.0005 ± 0.0005 NO2_lag_hour_7
0.0004 ± 0.0008 NO2_lag_hour_4
0.0004 ± 0.0007 PM10_lag_3
0.0004 ± 0.0001 PM10_lag_1
0.0003 ± 0.0002 PM25_lag_1
0.0003 ± 0.0004 PM10_lag_hour_7
0.0002 ± 0.0001 PM25_lag_6
0.0002 ± 0.0004 NO2_lag_3
0.0002 ± 0.0002 PM25_lag_5
0.0002 ± 0.0002 PM25_lag_7
0.0002 ± 0.0004 C7H8
0.0001 ± 0.0003 NO2_lag_5
0.0001 ± 0.0001 NO2_lag_2
0.0001 ± 0.0002 weekend
0.0001 ± 0.0003 PM10_lag_5
0.0001 ± 0.0001 NO2_lag_6
0.0001 ± 0.0001 NO2_lag_7
0.0000 ± 0.0000 PM10_lag_7
0.0000 ± 0.0000 afternoon
0.0000 ± 0.0004 C6H6
0 ± 0.0000 year
-0.0000 ± 0.0002 day
-0.0000 ± 0.0001 weekday
-0.0000 ± 0.0003 NO2_lag_1
-0.0001 ± 0.0001 PM25_lag_4
-0.0001 ± 0.0001 PM10_lag_6
-0.0001 ± 0.0012 PM25_lag_2
-0.0002 ± 0.0003 PM25_lag_3
-0.0002 ± 0.0002 NO2_lag_4
-0.0002 ± 0.0007 week
-0.0004 ± 0.0004 PM10_lag_4
Weight Feature
0.4681 ± 0.0191 PM25_lag_hour_1
0.4278 ± 0.0115 PM10
0.0203 ± 0.0022 PM25_lag_hour_2
0.0136 ± 0.0011 PM25_lag_hour_3
0.0058 ± 0.0019 FN
0.0047 ± 0.0028 PM10_lag_hour_2
0.0046 ± 0.0006 PM10_lag_hour_3
0.0038 ± 0.0012 PM25_lag_hour_5
0.0036 ± 0.0011 PM25_lag_hour_4
0.0029 ± 0.0010 PM10_lag_hour_1
0.0023 ± 0.0005 NO2_lag_hour_1
0.0022 ± 0.0007 PM25_lag_hour_6
0.0018 ± 0.0012 month
0.0017 ± 0.0010 hour
0.0013 ± 0.0003 PM10_lag_hour_5
0.0013 ± 0.0005 PM10_lag_hour_4
0.0011 ± 0.0009 PM10_lag_hour_6
0.0010 ± 0.0003 PM25_lag_hour_7
0.0010 ± 0.0012 PM25_lag_1
0.0009 ± 0.0005 NO
0.0005 ± 0.0002 C6H6
0.0004 ± 0.0001 NO2
0.0004 ± 0.0006 PM25_lag_5
0.0003 ± 0.0005 NO2_lag_hour_4
0.0003 ± 0.0003 PM10_lag_hour_7
0.0002 ± 0.0003 NO2_lag_hour_6
0.0002 ± 0.0003 NO2_lag_3
0.0002 ± 0.0002 PM25_lag_2
0.0002 ± 0.0002 NO2_lag_7
0.0002 ± 0.0003 PM25_lag_7
0.0001 ± 0.0002 NO2_lag_hour_5
0.0001 ± 0.0008 NO2_lag_hour_3
0.0001 ± 0.0003 weekday
0.0001 ± 0.0004 day
0.0001 ± 0.0000 NO2_lag_5
0.0001 ± 0.0003 PM10_lag_6
0.0001 ± 0.0000 weekend
0.0001 ± 0.0002 NO2_lag_hour_7
0.0000 ± 0.0002 PM10_lag_2
0.0000 ± 0.0000 afternoon
0.0000 ± 0.0005 C7H8
0.0000 ± 0.0005 PM10_lag_7
0.0000 ± 0.0002 NO2_lag_2
0.0000 ± 0.0003 PM10_lag_1
0 ± 0.0000 year
-0.0000 ± 0.0001 PM25_lag_3
-0.0000 ± 0.0001 PM25_lag_4
-0.0000 ± 0.0003 NO2_lag_hour_2
-0.0000 ± 0.0001 NO2_lag_6
-0.0000 ± 0.0001 PM25_lag_6
-0.0001 ± 0.0001 NO2_lag_1
-0.0001 ± 0.0004 NO2_lag_4
-0.0001 ± 0.0004 PM10_lag_3
-0.0003 ± 0.0002 PM10_lag_5
-0.0003 ± 0.0004 PM10_lag_4
-0.0007 ± 0.0014 week
Weight Feature
0.5837 ± 0.0153 NO2_lag_hour_1
0.2427 ± 0.0033 NO
0.0764 ± 0.0026 FN
0.0285 ± 0.0008 hour
0.0093 ± 0.0011 PM10
0.0069 ± 0.0008 NO2_lag_hour_2
0.0047 ± 0.0004 week
0.0022 ± 0.0003 PM25
0.0017 ± 0.0006 C6H6
0.0015 ± 0.0009 PM25_lag_hour_1
0.0014 ± 0.0002 weekend
0.0013 ± 0.0001 NO2_lag_hour_3
0.0012 ± 0.0001 NO2_lag_1
0.0011 ± 0.0001 C7H8
0.0011 ± 0.0006 month
0.0010 ± 0.0002 NO2_lag_hour_7
0.0007 ± 0.0002 weekday
0.0006 ± 0.0007 PM10_lag_hour_1
0.0004 ± 0.0001 PM10_lag_hour_6
0.0003 ± 0.0001 NO2_lag_hour_4
0.0003 ± 0.0002 NO2_lag_2
0.0002 ± 0.0001 afternoon
0.0002 ± 0.0002 NO2_lag_7
0.0001 ± 0.0001 PM10_lag_hour_4
0.0001 ± 0.0000 NO2_lag_6
0.0001 ± 0.0001 PM10_lag_hour_7
0.0001 ± 0.0001 NO2_lag_3
0.0001 ± 0.0001 PM25_lag_3
0.0000 ± 0.0001 NO2_lag_4
0.0000 ± 0.0000 NO2_lag_5
0 ± 0.0000 year
-0.0000 ± 0.0001 NO2_lag_hour_6
-0.0000 ± 0.0002 NO2_lag_hour_5
-0.0000 ± 0.0002 PM25_lag_hour_3
-0.0000 ± 0.0001 PM10_lag_6
-0.0001 ± 0.0000 PM10_lag_7
-0.0001 ± 0.0000 PM10_lag_hour_5
-0.0001 ± 0.0001 PM25_lag_7
-0.0001 ± 0.0001 PM10_lag_3
-0.0001 ± 0.0001 PM10_lag_2
-0.0001 ± 0.0001 PM10_lag_4
-0.0001 ± 0.0003 day
-0.0001 ± 0.0001 PM25_lag_hour_7
-0.0002 ± 0.0001 PM25_lag_6
-0.0002 ± 0.0001 PM25_lag_hour_6
-0.0002 ± 0.0001 PM25_lag_4
-0.0003 ± 0.0001 PM10_lag_hour_3
-0.0003 ± 0.0001 PM10_lag_1
-0.0003 ± 0.0001 PM10_lag_5
-0.0003 ± 0.0001 PM25_lag_hour_4
-0.0004 ± 0.0004 PM25_lag_hour_2
-0.0004 ± 0.0001 PM10_lag_hour_2
-0.0004 ± 0.0001 PM25_lag_hour_5
-0.0004 ± 0.0001 PM25_lag_5
-0.0006 ± 0.0002 PM25_lag_1
-0.0006 ± 0.0002 PM25_lag_2

We also tested some statistical features, but they were not as useful.

In [ ]:
# Statistical features
targets = ['NO2', 'PM10', 'PM25']
for t in targets:
  medians = pd.DataFrame(df.groupby(['weekday', 'hour'])[t].median().astype(int)).reset_index()
  medians = medians.rename(columns={t:f'{t}_median'})
  df = df.merge(medians, on=['weekday', 'hour'], how='left')

  stds = pd.DataFrame(df.groupby(['weekday', 'hour'])[t].std().astype(int)).reset_index()
  stds = stds.rename(columns={t:f'{t}_std'})
  df = df.merge(stds, on=['weekday', 'hour'], how='left')

  mins = pd.DataFrame(df.groupby(['weekday', 'hour'])[t].min().astype(int)).reset_index()
  mins = mins.rename(columns={t:f'{t}_min'})
  df = df.merge(mins, on=['weekday', 'hour'], how='left')

  maxs = pd.DataFrame(df.groupby(['weekday', 'hour'])[t].max().astype(int)).reset_index()
  maxs = maxs.rename(columns={t:f'{t}_max'})
  df = df.merge(maxs, on=['weekday', 'hour'], how='left')

  df_mornings = df[(df.hour >= 6) & (df.hour < 12)]
  morning_avgs = pd.DataFrame(df_mornings.groupby(['month', 'day'])[t].median().astype(int)).reset_index()
  morning_avgs = morning_avgs.rename(columns={t:f'{t}_morning_avg'})
  df = df.merge(morning_avgs, on=['month', 'day'], how='left')

  quantile25 = pd.DataFrame(df.groupby(['weekday', 'hour'])[t].quantile([.25]).astype(int)).reset_index()
  quantile25 = quantile25.rename(columns={t:f'{t}_quantile25'}).drop(['level_2'], axis=1)
  df = df.merge(quantile25, on=['weekday', 'hour'], how='left')

  quantile75 = pd.DataFrame(df.groupby(['weekday', 'hour'])[t].quantile([.75]).astype(int)).reset_index()
  quantile75 = quantile75.rename(columns={t:f'{t}_quantile75'}).drop(['level_2'], axis=1)
  df = df.merge(quantile75, on=['weekday', 'hour'], how='left')